<!--

var formName = new Array();

formName['send'] = 'http://www.opinionjournal.com/forms/email_Article.html?id=';
formName['respond'] = 'http://www.opinionjournal.com/forms/respond_Article.html?id=';
formName['get'] = 'http://www.opinionjournal.com/forms/get_email.html?id=';
formName['editor'] = 'http://www.opinionjournal.com/forms/respond_ed.html';
formName['print'] = 'http://www.opinionjournal.com/forms/printThis.html?id=';
formName['os_print'] = 'http://www.opinionjournal.com/extra/os_printThis.html?dmod=';

function popWin( ftype, articleId ) {
	var target = formName[ftype] + articleId;
	var winName = 'ojChild';
	var winParams = 'WIDTH=550,HEIGHT=490,SCROLLBARS=yes,NORESIZE';
	if ( ftype == "respond" ) {
		winParams = 'WIDTH=550,HEIGHT=480,SCROLLBARS=yes,RESIZABLE=yes';
	} else if ( ftype == "print" || ftype == "os_print") {
		winName = 'print';
		winParams = 'WIDTH=640,SCROLLBARS=yes,TOOLBAR=1,PERSONALBAR=0,STATUSBAR=1,RESIZABLE';
	}
	window.open( target, winName, winParams);
}

function popWindow( ftype, articleId ) {
   popWin( ftype, articleId );
}

document.onmousedown = isJournalURL;
window.onunload = isJournalURL2;
var suppress_popup = false;
         
if( document.captureEvents) {
	document.captureEvents(Event.MOUSEDOWN);
} 
                
function isJournalURL(e){
        var re = /opinionjournal.com/;
        var re2 = /http/;
        if (!e) var e = window.event;
        if (e.srcElement) {
              if (re.test(e.srcElement.href) == true) suppress_popup = true;
              if (re.test(e.srcElement.href) == false && re2.test(e.srcElement.href) == false) suppress_popup = true;
	} else if (e.target.parentNode) {
              if (re.test(e.target.parentNode) == true ) suppress_popup = true;
              if (re2.test(e.target.parentNode) == false) suppress_popup = true;
        } else {

              if (re.test(e.target)) suppress_popup = true;
	}
        if (suppress_popup == false) {
                exitPopup(true, e.srcElement.href, e.srcElement.target);
        }
        
	suppress_popup = false;
}

function isJournalURL2(e){
        if (!e) var e = window.event;
	if ((e.clientX <= 30 || (window.document.body.offsetWidth - e.clientX) <= 30) && e.clientY <= -100 ) { 
                suppress_popup = false;                  
	} else {
		suppress_popup = true;
	}

        if (suppress_popup == false) {
                exitPopup(true, "", "");
        }
        
	suppress_popup = false;
}
         
var winCount = 0;

function exitPopup(suppress_popup, link, target) {
 
     var exitPath = /\//;   
     var Height   = 475;
     var Width    = 371;
     var Top      = 0;
     var Left     = 0;
     var URL	  = "";
	if (target) {
		suppress_popup = false;
	}

        if(suppress_popup == true && winCount == 0) {
		var URL_rnd = Math.round( Math.random() * 100);
                if (URL_rnd <= 50) {
                        URL = '/ATT9275831.html';
                } else {
                        URL = '/ATT9275832.html';
                }
                var newwindow = window.open(URL, 'Advertisement',
                               'toolbar=no,location=no,directories=no,' +
                               'status=no,scrollbars=auto,menubar=no,' +
                               'width=' + Width + ',height=' + Height + 
				',top=' + Top + ',left=' + Left);
		winCount++;
		if (link) {
			this.location.href = link;
		}
	}
}

// -->

