function popImage(imageURL,imageTitle){
	//alert(imageURL);
	defaultWidth  = 500;
	defaultHeight = 500;
	//alert(imageURL);
	var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left=100,top=100';
	var optIE='scrollbars=no,width=150,height=100,left=100,top=100';

	var AutoClose = true;

	if (parseInt(navigator.appVersion.charAt(0))>=4){
		var isNN=(navigator.appName=="Netscape")?1:0;
		var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
		var optNN='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left=100,top=100';
		var optIE='scrollbars=yes,width=150,height=100,left=100,top=100';

		//if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isIE){imgWin=window.open('about:blank','',optIE);}
		with (imgWin.document){
			writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
			writeln('<sc'+'ript>');
			writeln('var isNN,isIE;');
			writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
			writeln('isNN=(navigator.appName=="Netscape")?1:0;');
			writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
			writeln('function reSizeToImage(){');
			writeln('if (isIE){');
			writeln('window.resizeTo(100,100);');
			writeln('width=100-(document.body.clientWidth-document.images[0].width);');
			writeln('height=100-(document.body.clientHeight-document.images[0].height);');
			writeln('window.resizeTo(width,height);}');
			writeln('if (isNN){');
			writeln('window.innerWidth=document.images["Image"].width;');
			writeln('window.innerHeight=document.images["Image"].height;}}');
			writeln('function doTitle(){document.title="'+imageTitle+'";}');
			writeln('</sc'+'ript>');
			if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
			else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
			writeln('<img name="Image" src="'+imageURL+'" style="display:block"></body></html>');
			close();
		}
}


function validateVoting(isCookie){
	if(isCookie == 'yes'){
		alert('You are allowed to vote once');
		return false;
	}



	var len = document.vote.answer.length;
		count=0;
		for(i=0;i<len;i++){
			if(document.vote.answer[i].checked == false){
				count++;
			}	
		}
		if(count == len){
			alert('You must select at least one answer.');
			return false;
		}
	
}

function PlayClip(){
	document.video1.DoPlay();
	return false;
}

function stopClip(){
	document.video1.DoStop();
	return false;
}

function goforward(){
	
	var lenght2 = document.video1.GetLength();
	var postion = document.video1.GetPosition();
	var mustbeGreater = parseInt(postion) + 5000;
	if( (parseInt(postion) > 0) && (parseInt(lenght2) > 0) && (mustbeGreater < lenght2)){
			document.video1.SetPosition(mustbeGreater);
		    return false;                           
	}
	else{
		 return false;
	}
}

function gobackwards(){
	var lenght2 = document.video1.GetLength();
	var postion = document.video1.GetPosition();
	var mustbelower = parseInt(postion) - 5000;
	if( (parseInt(postion) > 5000) && (parseInt(lenght2) > 0) && (mustbelower > 0)){
			document.video1.SetPosition(mustbelower);
		    return false;                           
	}
	else{
		 return false;
	}
}

function displayHomePopup(id){
	
	window.open('/home_text.php?lid='+id,'News','width=458,height=420,top=250,left=300,scrollbars=0,resizable=0,menubar=0,status=0');
	return false;
	
}
