<!-- Hide script from old browsers
// Make sure file is not hosted in a different frameset
//if ( top.location.href != window.location.href )
//  { top.location.href=window.location.href }

// ------------------------------------------------------------------

function openWindow(url,wname,w,h,props) 
{
	var winTop=(screen.height-h)/2;
	var winLeft=(screen.width-w)/2;
	
	var windowprops = "width=" + w + ",height=" + h +",left="+winLeft+",top="+winTop+","+props;
	return window.open(url,wname,windowprops);
} 

// ------------------------------------------------------------------
// Open dynamic PopUp window without scrollbars etc
// ------------------------------------------------------------------
var win=null;
function getEmail(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=20;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
win=window.open(mypage,myname,settings);
win.focus();
}
	

// ------------------------------------------------------------------
// Open PopUp window without standard titlebar and borders under IE
// ------------------------------------------------------------------
function openPopUp(winName,title,content,iWidth,iHeight) 
{
	var iTop=(screen.height-iHeight)/2;
	var iLeft=(screen.width-iWidth)/2;

	var win = window.open("",winName, "fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top="+iTop+",left="+iLeft+",width=" + iWidth + ",height=" + iHeight);
	
	win.document.write('<html>');
	win.document.write('<head>');
	win.document.write('<title>'+title+'</title>');
	win.document.write('<link href="../common/cstyle.css" type="text/css" rel="stylesheet">');
	win.document.write('</head>');
	win.document.write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll="no">');
	win.document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class="popUpBorder">');
	win.document.write('<tr><td>');
	win.document.write('<table border="0" cellspacing="1" cellpadding="4" width="100%" height="100%">');
	win.document.write('<tr><td class="popUpTitle" height="25">'+title+'</td></tr>');
	win.document.write('<tr><td class="popUpBody" valign="top">'+content+'</td></tr>');
	win.document.write('</table>');
	win.document.write('</td></tr>');		
	win.document.write('</table></body></html>');
	win.document.close();
	
	win.focus();
	return false;
}

// ------------------------------------------------------------------

function openPicture(pic,w,h) {
 
	var windowprops = "left=160,top=100,scrollbars=no,status=yes,toolbar=no,location=no,directories=no,resizable=yes,width=" + w + ",height=" + h;
      
	picture = window.open('','newPicture',windowprops);
	picture.close();
    picture = window.open('','newPicture',windowprops);  
    picture.focus();
    
	picture.document.write("<html><head><title>Picture<\/title><\/head><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>")
	picture.document.writeln("<img src=" + pic + " width=" + w + " height=" + h + ">")
	picture.document.write("<\/body><\/html>")
}                

// ------------------------------------------------------------------

function switchClass(obj,strClassName) {
		obj.className	= strClassName;
}

// ------------------------------------------------------------------

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
// ------------------------------------------------------------------
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}


// ------------------------------------------------------------------
// Email validation
// ------------------------------------------------------------------
function isValidEmail(email)
{
	return email.match('^.+@.+[.].+$') ? 1 : 0;
}

function ToggleSelectTag(select)
{
	// Check if an option differ that "Any" is selected
	// and if does then unselect "Any"(the first option)
											
	for (var i=1;i<select.length-1;i++)
	{
		if (select.options[i].selected)
			if (select.options[0].selected)
			{
				select.options[0].selected=false;
				return;
			}
	}
}

function copyrightYear(startYear)
	{
		d = new Date();
		
		if (startYear != d.getFullYear())
			{
			return startYear + " - " + d.getFullYear();
			}
		else
			{
			return startYear;
			}
	}


function setPrevImg()
{
	
	if (iFirstImg > 1)
	{
		document.getElementById("img1").innerHTML = aImages[iFirstImg - 1];
		document.getElementById("img2").innerHTML = aImages[iFirstImg];
		document.getElementById("img3").innerHTML = aImages[iFirstImg + 1];
		document.getElementById("img4").innerHTML = aImages[iFirstImg + 2];
		iFirstImg--;
	}
	
	return false;
}

function setNextImg()
{
	
	if (iFirstImg < (iImgCount - 3))
	{
		document.getElementById("img1").innerHTML = aImages[iFirstImg + 1];
		document.getElementById("img2").innerHTML = aImages[iFirstImg + 2];
		document.getElementById("img3").innerHTML = aImages[iFirstImg + 3];
		document.getElementById("img4").innerHTML = aImages[iFirstImg + 4];
		iFirstImg++;
	}
	
	return false;
}

function showTitleImage(sLink)
{
	document.location = sLink + "&frid="+iFirstImg;
	return false;
}

// End hiding script from old browsers -->