function switch_visibility(elem_id)
{
    if (document.getElementById(elem_id).style.display!="block")
    {
        document.getElementById(elem_id).style.display="block";
    }
    else
    {
        document.getElementById(elem_id).style.display="none";
    }
}

function switch_color(elem_id,bgcolor,color)
{
    document.getElementById(elem_id).style.background=bgcolor;
    document.getElementById(elem_id).style.color=color;
}

function switch_act(elem_id)
{
    if(document.getElementById(elem_id).style.background=="#556984")
    {
        document.getElementById(elem_id).style.background="";
        document.getElementById(elem_id).style.color="#A9B7D1";
        document.getElementById(elem_id).style.BorderTopWidth="5px";
        document.getElementById(elem_id).style.borderColor="black";
    }
    else
    {
        document.getElementById(elem_id).style.background="#556984";
        document.getElementById(elem_id).style.color="white";
    }
}

function switch_act2(elem_id)
{
    if(document.getElementById(elem_id).style.background=="")
    {
        document.getElementById(elem_id).style.background="#E3B5B8";
    }
    else if(document.getElementById(elem_id).style.background="#E3B5B8")
    {
        document.getElementById(elem_id).style.background="";
    }
}

function enlargement(adr,w,h)
{
    m='Kurt,Safir&Saray';
	wh = getWindowHeight();
	//alert(wh+' - '+h);
    if (h > wh)
		{
		s=1;
		w = w + 18;
		h = wh - 40;
		//alert(wh);
		}
	else
		{
		s=0;
		}
	

    o='toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,scrollbars='+s+',width='+w+',height='+h;if(s){o+=',top=10,left=10'};
    wd=window.open('','',o);wd.document.write('<html><head><title>'+m+'</title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><img src=\''+escape(adr)+'\' alt=\''+m+'\'/></body></html>');
}




function popUp(url,width,height,name) 
{
popUpOpenWin=window.open(url, name, "width="+width+",height="+height+",toolbar=no,focus=yes,menubar=no,location=no,scrollbars=no,resizable=yes,status");
popUpOpenWin.focus();
}


function vipvideo()
{
if (top.bottom.document)
{
	top.bottom.document.location.replace('bottom.php?nosound=1');
}
else
{
parent.bottom.document.location.replace('bottom.php?nosound=1');
}
OpenWin=window.open('vipvideo', 'video', "width=322,height=310,toolbar=no,focus=yes,menubar=no,location=no,scrollbars=no,resizable=no,status=no");
OpenWin.focus();
}

function video(name, url, w, h)
{
if (top.bottom.document)
{
	top.bottom.document.location.replace('bottom.php?nosound=1');
}
else
{
parent.bottom.document.location.replace('bottom.php?nosound=1');
}
OpenWin=window.open(url, name, "width="+w+",height="+h+",toolbar=no,focus=yes,menubar=no,location=no,scrollbars=no,resizable=no,status=no");
OpenWin.focus();
}

function ipix(url,objid)
{
OpenWin=window.open('ipix?url='+url+'&objid='+objid, 'ipix', "width=640,height=480,toolbar=no,focus=yes,menubar=no,location=no,scrollbars=no,resizable=no,status=no");
OpenWin.focus();
}



function printobject(id,langid)
{
OpenWin=window.open('printobject.php?id='+id+'&langid='+langid, 'print', "width=640,height=400,toolbar=no,focus=yes,menubar=no,location=no,scrollbars=yes,resizable=yes,status=yes");
OpenWin.focus();
}



function mailobject(id,langid)
{
OpenWin=window.open('mailafriend.php?id='+id+'&langid='+langid, 'print', "width=500,height=430,toolbar=no,focus=yes,menubar=no,location=no,scrollbars=no,resizable=no,status=no");
OpenWin.focus();
}



function checkMail(address)
	{
	var filter= /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 
	// old: /^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (filter.test(address))
		return true;
	else
		return false;
	}



function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
