window.self.name='openerWindow';

var gWidth=540;
var gHeight=580;







function popup1(URL,w,h) {
    if (document.all)
    {
        var xMax = screen.width, yMax = screen.height;
    }
    else
    {
        if (document.layers)
        {
            var xMax = window.outerWidth, yMax = window.outerHeight;
		}
        else
        {
            var xMax = 640, yMax=480;
        }
	}

	var xOffset = (xMax - w)/2
	var yOffset = (yMax - h)/2
	var sCenteringString;
	day = new Date();
	id = day.getTime();
	sCenteringString = ',screenX=' + xOffset + ',screenY=' + yOffset + ',top='+ yOffset + ',left=' + xOffset + ''
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h + sCenteringString);");
}


function p(URL) {
    //var sP=window.open(URL, 'P','status=1,toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=0,height=0,top=0,left=3000');
	//var w=500;
	//var h=590;
	
	URL="http://www.islamicity.com" + URL

	var w=413;
	var h=670;	
	if (document.all)
	{
		var xMax = screen.width, yMax = screen.height;
	}
	else
	{
		if (document.layers)
		{
			var xMax = window.outerWidth, yMax = window.outerHeight;
		}
		else
		{
			var xMax = 640, yMax=480;
		}
	}

	var xOffset = (xMax - w)/2
	var yOffset = (yMax - h)/2
	var sCenteringString;
	day = new Date();
	id = day.getTime();
	sCenteringString = ',screenX=' + xOffset + ',screenY=' + yOffset + ',top='+ yOffset + ',left=' + xOffset + ''
	//alert('ok')
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h + sCenteringString);");
	
}



function mp(URL) {
    //var sP=window.open(URL, 'P','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=0,height=0,top=0,left=3000');
    	var iUserBandWidth;
    	var iScreenW=screen.width;
    	var iScreenH=screen.height;
    	alert(iScreenW);
    	alert(iScreenH);
    	alert(iUserBandWidth);
	var w=516;
	var h=590;
	if (document.all)
	{
		var xMax = screen.width, yMax = screen.height;
	}
	else
	{
		if (document.layers)
		{
			var xMax = window.outerWidth, yMax = window.outerHeight;
		}
		else
		{
			var xMax = 640, yMax=480;
		}
	}

	var xOffset = (xMax - w)/2
	var yOffset = (yMax - h)/2
	var sCenteringString;
	day = new Date();
	id = day.getTime();
	sCenteringString = ',screenX=' + xOffset + ',screenY=' + yOffset + ',top='+ yOffset + ',left=' + xOffset + ''
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h + sCenteringString);");
	
}



document.write ("<FORM style = 'display:inline;'  target=\"formWindow\" action=\"\" name=\"frmP\" METHOD=POST></form>")

 
 function q(sActionPath){
  
  window.self.name='openerWindow';
  postToPopup(this,"width=0,height=0,top=0,left=3000",sActionPath);
 }
 

 function postToPopup(f,decorations,sActionPath) {
 
  var targetWindow = window.open("","formWindow",decorations);
 
  window.document.frmP.action=sActionPath ; 
  window.document.frmP.submit(); 
 }




function popup1noscroll(URL,w,h) {
    if (document.all)
    {
        var xMax = screen.width, yMax = screen.height;
    }
    else
    {
        if (document.layers)
        {
            var xMax = window.outerWidth, yMax = window.outerHeight;
		}
        else
        {
            var xMax = 640, yMax=480;
        }
	}

	var xOffset = (xMax - w)/2
	var yOffset = (yMax - h)/2
	var sCenteringString;
	day = new Date();
	id = day.getTime();
	sCenteringString = ',screenX=' + xOffset + ',screenY=' + yOffset + ',top='+ yOffset + ',left=' + xOffset + ''
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h + sCenteringString);");
}


function pop(sURL,sWin,sWindowProp){
	var win=window.open(sURL,sWin,sWindowProp)
}

function contains(smstring,lrgstring) {
	//returns true if lrgstring contains smstring.
	//case insensitive
	smstring=smstring.toLowerCase();
	lrgstring=lrgstring.toLowerCase();
	strlen1 = smstring.length
	strlen2 = lrgstring.length
	istrue = false
	for (i=0;i<=strlen2;i++) {
		comp=lrgstring.substring(i-1,strlen2)
		comp = comp.substring(0,strlen1)
		if (comp == smstring) {
			istrue = true
			break
		}
	}
	return istrue
}


var sRef=document.referrer;
if (contains("jenin.",sRef) )
{
	window.document.location.href=sRef;
}
if (contains("SabraShatila.",sRef) )
{
	window.document.location.href=sRef;
}
window.status=sRef;


function ServeSearchWord(sInput)
{
	
var winServe;
if ((sInput.length)>0)
{
	winServe=window.open('http://www.islamicity.com/global/ssw.asp?word='+escape(sInput),'winServe','width=400,height=400,top=10000,left=10000')
}


	
	
}
