var expDays = 30

var expDays = 30

function setCookie(name, val) {
var exp = new Date();
var cookieTimeToLive = exp.getTime() + (expDays * 24 * 60 * 60 * 1000);
exp.setTime(cookieTimeToLive);
document.cookie = name + "=" + escape(val) + "; expires=" + exp.toGMTString();
}

function getCookie(name) {
var cookieNameLen = name.length;
var cLen = document.cookie.length;
var i = 0;
var cEnd;
var myStringToReturn;
var myStringToReturnLen;
while (i < cLen) {
var j = i + cookieNameLen;
if (document.cookie.substring(i,j) == name) {
cEnd = document.cookie.indexOf(";",j);
if (cEnd == -1) {
cEnd = document.cookie.length;
}
myStringToReturn = unescape(document.cookie.substring(j,cEnd));
myStringToReturnLen = myStringToReturn.length;
myStringToReturn = myStringToReturn.substring(1,myStringToReturnLen+1);
return myStringToReturn;
}
i++;
}
return "";
}

function  back_to_ads(url) {
 document.location.href= url; 
}


function setDefaultValues() {
var strCookieName, strCookieVal;
var iFormsCount = 0;
var iElementsCount = 0;
for(iFormsCount=0;iFormsCount < document.forms.length;iFormsCount++) {
for(iElementsCount=0; iElementsCount < document.forms[iFormsCount].elements.length; iElementsCount++) {
strCookieName = document.forms[iFormsCount].elements[iElementsCount].name;
strCookieVal = getCookie(strCookieName);
if (strCookieVal != null && !(isNaN(strCookieVal)) && strCookieVal != '') {
document.forms[iFormsCount].elements[iElementsCount].selectedIndex = strCookieVal;
         }
      }
   }
}


function getElement(id) { 

	return document.getElementById ? document.getElementById(id) : 
						document.all ? document.all(id) : null; 
} 


function show_hide(id) 
{
	obj = getElement(id);
	if (obj.style.display == 'none') { obj.style.display = '';}
	else 	{ obj.style.display = 'none';	}
}


function redirect(url)
{
	if(url!="") document.location = url;
}

			
function do_search(form) 
{
	if (form.Search.value != "") {form.submit();}
}

function startTime()
{
	var today=new Date()
	var h=today.getHours()
	var m=today.getMinutes()
	var s=today.getSeconds()
	// add a zero in front of numbers<10
	m=checkTime(m)
	s=checkTime(s)
	document.getElementById('time').innerHTML=h+":"+m+":"+s
	t=setTimeout('startTime()',500)
}

function checkTime(i)
{
	if (i<10) 
	  {i="0" + i}
	  return i
}


function switch_view(id1, id2) 
{

	obj1 = getElement(id1);
	obj2 = getElement(id2);
	obj1.style.display = '';
	obj2.style.display = 'none';
}

function mark_unmark(id1, id2) 
{
	obj1 = getElement(id1);
	obj2 = getElement(id2);

	obj1.style.color = "Red";
	obj2.style.color = "";
}

function setLinkVid(num) 
{
	 if (num == 0) { self.location="new_imoti.htm" }
	 if (num == 1) { self.location="new_imoti_Buy.htm" }
 }

function setLinkRegion(num) 
{
	 if (num == 1) { self.location="new_imoti.htm" } 
	 else {self.location="new_imoti_all.htm"}
}



function MM_goToURL() 
{ //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

//open image with image Title in new window
function popImage(imageURL,imageTitle)
{
	PositionX = 100;
	PositionY = 100;
	
	defaultWidth  = 500;
	defaultHeight = 500;
	
	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=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
	var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
	
	var imageURL = imageURL;
	imageURL = imageURL.replace(' ','%20');
	
	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["bigPicture"].width;');writeln('window.innerHeight=document.images["bigPicture"].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="bigPicture" src='+imageURL+' style="display:block"></body></html>');
		close();		
	}
}

function popupWindow(url)
{
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=300,screenX=150,screenY=150,top=150,left=150')
}