// The following functions are used in Home Page which is plaing Videos 

//changeMainLogoImage();
//setPgTitle();

var boxBorderColorOn ="2px solid #ADB9B7";
var boxBorderColorOf ="0px solid #ADB9B7";


function displayLastUpdDt(){
 	document.write("<br><span id='otvtextlangspan' class=text-font>Last Updated date : May 24, 2009</span>");
}

function clearBoxBorder(){

	for(i=0;i<10;i++){
		var leftspanmenuobj = document.getElementById("midtd" + i);
		if (leftspanmenuobj) { 
			leftspanmenuobj.style.border = "0px solid #ADB9B7";
			if (i < 6) {leftspanmenuobj.style.borderRight = "1px solid white";} // Highlight the tab
		}
	}
}

function goToAnchor() {
	var winloc = document.location.href;
	if (winloc.indexOf("videodescarea") < 0) {
		document.location.href = winloc + "#videodescarea";
	} else {
		document.location.href = winloc;
	}
}

function showhidecomments() {

	document.getElementById("descdiv").style.display = "none";
	//document.getElementById("attractionlinksdiv").style.display = "none";

 	k1 = document.getElementById("youtubecommentsdiv").style.display;
 	var leftspanmenuobj = document.getElementById("midtd8");clearBoxBorder();

	if (k1 == "none") {
		if (firstTimeShowDesc ==  0) {goToAnchor();}
		document.getElementById("youtubecommentsdiv").style.display = "block";
		if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOn;}

	} else {
		document.getElementById("youtubecommentsdiv").style.display = "none";
		if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOf;}
	}

}


function showhideattr(){
	document.getElementById("descdiv").style.display = "none";
	document.getElementById("youtubecommentsdiv").style.display = "none";
	
 	k1 = document.getElementById("attractionlinksdiv").style.display;
 	var leftspanmenuobj = document.getElementById("midtd1");clearBoxBorder();
 	
	if (k1 == "none") {
		if (firstTimeShowDesc ==  0) {goToAnchor();}
		document.getElementById("attractionlinksdiv").style.display = "block";
		if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOn;}
		
	} else {
		document.getElementById("attractionlinksdiv").style.display = "none";
		if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOf;}
	}
}
function showhidedesc(){

	//document.getElementById("attractionlinksdiv").style.display = "none";
	document.getElementById("youtubecommentsdiv").style.display = "none";
	
 	k1 = document.getElementById("descdiv").style.display;
 	var leftspanmenuobj = document.getElementById("midtd0");clearBoxBorder();
 	
	if (k1 == "none") {
		if (firstTimeShowDesc ==  0) {goToAnchor();}
		document.getElementById("descdiv").style.display = "block";
		if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOn;}
	} else {
		document.getElementById("descdiv").style.display = "none";
		if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOf;}
	}
}

// ------------------------------The following functions are used in Videos List - Start
function showdesc(idx){ 
	document.getElementById('div_attr_' + idx).style.display = 'none';
	if (document.getElementById('div_desc_' + idx).style.display == 'block') {
		document.getElementById('div_desc_' + idx).style.display = 'none';
	} else { 
		closeOtherAttr(idx);
		document.getElementById('div_desc_' + idx).style.display = 'block';
	}
}

function showattr(idx){
	document.getElementById('div_desc_' + idx).style.display = 'none';
	if (document.getElementById('div_attr_' + idx).style.display == 'block') {
		document.getElementById('div_attr_' + idx).style.display = 'none';
	} else { 
		closeOtherAttr(idx);
		document.getElementById('div_attr_' + idx).style.display = 'block';
	}
}
function closeOtherAttr(idx1){
	for(idx=0;idx < maxVideosCnt;idx++){
		if (idx != idx1) {
			document.getElementById('div_attr_' + idx).style.display = 'none';
			document.getElementById('div_desc_' + idx).style.display = 'none';
		}
	}
}
// ------------------------------The following functions are used in Videos List - END

// ------------------------------The following functions are used in Videos Map - Start

function changeytbpic(ytbvidid,imgidx){

	document.getElementById("img_ytb_map_1").src = 'http://img.youtube.com/vi/' + ytbvidid + '/' + imgidx + '.jpg';

}
function setcountry(){
	var countrylistbox = document.getElementById("country");
	if (countrylistbox) {
		countrylistbox.selectedIndex = 1;
	}
}

function showUSStates() {
	var st1 = '<select class=font1 id="state" name="state" onchange="setcountry();">' +
		'<option value="" selected>Select a US state</option>' + 
		'<option value="AL">Alabama</option>' + 
		'<option value="AK">Alaska</option>' + 
		'<option value="AZ">Arizona</option>' + 
		'<option value="AR">Arkansas</option>' + 
		'<option value="CA">California</option>' + 
		'<option value="CO">Colorado</option>' + 
		'<option value="CT">Connecticut</option>' + 
		'<option value="DE">Delaware</option>' + 
		'<option value="DC">D.C.</option>' + 
		'<option value="FL">Florida</option>' + 
		'<option value="GA">Georgia</option>' + 
		'<option value="HI">Hawaii</option>' + 
		'<option value="ID">Idaho</option>' + 
		'<option value="IL">Illinois</option>' + 
		'<option value="IN">Indiana</option>' + 
		'<option value="IA">Iowa</option>' + 
		'<option value="KS">Kansas</option>' + 
		'<option value="KY">Kentucky</option>' + 
		'<option value="LA">Louisiana</option>' + 
		'<option value="ME">Maine</option>' + 
		'<option value="MD">Maryland</option>' + 
		'<option value="MA">Massachusetts</option>' + 
		'<option value="MI">Michigan</option>' + 
		'<option value="MN">Minnesota</option>' + 
		'<option value="MS">Mississippi</option>' + 
		'<option value="MO">Missouri</option>' + 
		'<option value="MT">Montana</option>' + 
		'<option value="NE">Nebraska</option>' + 
		'<option value="NV">Nevada</option>' + 
		'<option value="NH">New Hampshire</option>' + 
		'<option value="NJ">New Jersey</option>' + 
		'<option value="NM">New Mexico</option>' + 
		'<option value="NY">New York</option>' + 
		'<option value="NC">North Carolina</option>' + 
		'<option value="ND">North Dakota</option>' + 
		'<option value="OH">Ohio</option>' + 
		'<option value="OK">Oklahoma</option>' + 
		'<option value="OR">Oregon</option>' + 
		'<option value="PA">Pennsylvania</option>' + 
		'<option value="RI">Rhode Island</option>' + 
		'<option value="SC">South Carolina</option>' + 
		'<option value="SD">South Dakota</option>' + 
		'<option value="TN">Tennessee</option>' + 
		'<option value="TX">Texas</option>' + 
		'<option value="UT">Utah</option>' + 
		'<option value="VT">Vermont</option>' + 
		'<option value="VA">Virginia</option>' + 
		'<option value="WA">Washington</option>' + 
		'<option value="WV">West Virginia</option>' + 
		'<option value="WI">Wisconsin</option>' + 
		'<option value="WY">Wyoming</option>' + 
		'</select>';
	document.write(st1);
}


var msgTypeErr = 1;
var msgTypeInf = 2;
var errortextareaBrdCol = "#AC703D";
var errortextareaBgCol = "#D5AA88";

function setClearMsgTimer(msgType,errMsg) {//1-Error(Red) 2-Information white bold

	var closeLink = "&nbsp;&nbsp;<a class=font1 href='javascript:closeErrMsg();'>Close</a>";
	var errortextarea=document.getElementById("errortextarea");var prevdisplaymsg = "";
	if (errortextarea) {
	        if (errortextarea.style.display == "block" &&  (errortextarea.innerHTML.indexOf(errMsg) < 0) ) {
	        	prevdisplaymsg =  errortextarea.innerHTML;
	        	prevdisplaymsg = prevdisplaymsg.replace(/Close/, "");//don't show more than a single close
	        }
		//<div id="errortextarea" style="display: none;"></div>
		errortextarea.style.textAlign = "center";
		errortextarea.style.display = "block" ;
		fontColor = "black";
		if (msgType == msgTypeErr) { fontColor="red";}
		errortextarea.style.color = fontColor;
		errortextarea.style.fontSize = "12px";
		errortextarea.style.marginTop = "0px";
		errortextarea.style.padding = "2px";
		errortextarea.style.backgroundColor = errortextareaBgCol;
		errortextarea.style.borderTop = "0px solid " + errortextareaBrdCol;//white
		errortextarea.style.borderLeft = "1px solid " + errortextareaBrdCol;//white
		errortextarea.style.borderBottom = "1px solid " + errortextareaBrdCol;//white
		errortextarea.style.borderRight = "1px solid " + errortextareaBrdCol;//white		
		if (msgType == msgTypeInf) {errortextarea.style.fontWeight="bold";}
		errortextarea.innerHTML = prevdisplaymsg + errMsg + closeLink;
		setTimeout ("clearErrMsgTimer()", 60000);
	}	   
}

function setClearMsgTimer1(msgType,errMsg) {//1-Error(Red) 2-Information white bold -- THis will not add the messages

	var closeLink = "&nbsp;&nbsp;<a class=font1 href='javascript:closeErrMsg();'>Close</a>";
	var errortextarea=document.getElementById("errortextarea");var prevdisplaymsg = "";
	if (errortextarea) {
	        if (errortextarea.style.display == "block" &&  (errortextarea.innerHTML.indexOf(errMsg) < 0) ) {
	        	prevdisplaymsg =  errortextarea.innerHTML;
	        	prevdisplaymsg = prevdisplaymsg.replace(/Close/, "");//don't show more than a single close
	        }
		//<div id="errortextarea" style="display: none;"></div>
		errortextarea.style.textAlign = "center";
		errortextarea.style.display = "block" ;
		fontColor = "black";
		if (msgType == msgTypeErr) { fontColor="red";}
		errortextarea.style.marginTop = "0px";
		errortextarea.style.color = fontColor;
		errortextarea.style.fontSize = "12px";
		errortextarea.style.backgroundColor = "#BADDD3";
		errortextarea.style.border = "0px 1px 1px 1px solid #78A095";//white
		if (msgType == msgTypeInf) {errortextarea.style.fontWeight="bold";}
		errortextarea.innerHTML = prevdisplaymsg + errMsg + closeLink;
		setTimeout ("clearErrMsgTimer()", 60000);
	}	   
}

function closeErrMsg() {
	clearErrMsgTimer();
}

function closeUpcoming() {
	var upcomingdiv=document.getElementById("upcomingdiv");//alert('timer stop 1');
	if (upcomingdiv) {
			upcomingdiv.style.display = "none" ;
	}
}

function clearErrMsgTimer() {
	var errortextarea=document.getElementById("errortextarea");//alert('timer stop 1');
	if (errortextarea) {
		errortextarea.style.display = "none" ;
	}
}

function detectBrowser()
{
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var userAgent = navigator.userAgent;
	var is_chrome = /chrome/.test( navigator.userAgent.toLowerCase() );
	var isAndroid = userAgent.toLowerCase().indexOf("android") > -1; //&& ua.indexOf("mobile");		

	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
	 	var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
	 	//if (ffversion>=3) document.write("You're using FF 3.x or above")
	  	//alert("your browser - FireFox vers - " + ffversion);
	  	//setClearMsgTimer(msgTypeErr,"Your browser is " + "Firefox" + " Version " + ffversion + ".<br><br>");
	  	
	} else if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	 	var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 		//if (ieversion>=8)
 		//alert("your browser - IE vers - " + ieversion);
 		if (ieversion < 6 ) {
 		   //alert("Your browser is IE Version " + ieversion + ". Please use IE Version >=7/Chrome/Firefox for better view.");
		   	setClearMsgTimer(msgTypeErr,"Your browser is IE Version " + ieversion + ". Better viewed with IE Version 6 or later or Google Chrome or Firefox.<br><br>");
 		}
 		
	} else if (is_chrome) {
			//alert("Your browser is Chrome");
	} else if(isAndroid) {
			//alert("Your browser is Android");
	} else {
		if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
			var sPath = window.location.pathname;
			var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
			//alert(sPage);
			if (sPage == "index.php"){
				setClearMsgTimer(msgTypeInf,"Flash videos may not be supported by iPhone/iPod. Due to the flash restrictions, you will watch only the short version of YouTube video on this mobile. Please watch full video on computer or other supported device.<br><br>");
			}
		} else {

			if ((navigator.userAgent.toLowerCase().indexOf("safari") > -1)) { 
				if ((browser_detect.indexOf("macintosh") > -1)) {
					if (sPage == "index.php"){
						setClearMsgTimer(msgTypeErr,"Flash videos may not be supported by MAC OS.<br><br>");
					}
				}
			} else {
				//alert("your browser - " + browser + " vers - " + b_version + " userAgent - " + userAgent);
				setClearMsgTimer(msgTypeErr,"Your browser is " + browser + " Version " + b_version + ". Better viewed with IE Version 7/Later OR Google Chrome OR Firefox OR Mobile with Android.<br><br>");
			}
		}
	}

}


/* Modified to support Opera */
function bookmarksite(){

	var leftspanmenuobj = document.getElementById("midtd6");clearBoxBorder();
	if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOn;}
	
	title = "OurTripVideos - Home";
	url = "http://www.ourtripvideos.com";
	
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
		
}


function fbs_click() { // facebook related function - work with icon
	u=location.href;
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}

function changeMainLogoImage(){
        //alert(1);
	var img_name = new Array("logo1.gif", "logo3.gif","logo4.gif", "logo5.gif","logo6.gif");
	var l = img_name.length;
	var rnd_no = Math.floor(l*Math.random());
	if (document.getElementById("r_img")) {//alert(2);
		document.getElementById("r_img").src = "/images/topbanner/" + img_name[rnd_no];
		//alert(document.getElementById("r_img").src);
	}
}

function changetime1(){// on home page videos play page

	 var is_chrome = /chrome/.test( navigator.userAgent.toLowerCase() );
	 var curDateTime = new Date();
	 var curDateTimeStr = curDateTime.toLocaleString();
	 var daypos = curDateTimeStr.indexOf(',');var day = curDateTimeStr.substr(0,daypos);
	 var shortdt = day.substr(0,3) +  curDateTimeStr.substr(daypos,40);//'Wed, April 08, 2009 9:32:46 PM'
	 var datetimespan = document.getElementById("datetimespan");
	 if (datetimespan) {datetimespan.innerHTML = shortdt;}//curDateTime.toGMTString();
	 if (is_chrome) {if (datetimespan) {datetimespan.innerHTML = '';}}
}

function changetime(){// on home page videos play page

    var is_chrome = /chrome/.test( navigator.userAgent.toLowerCase() );
    var curDateTime = new Date();
    var curDateTimeStr = curDateTime.toLocaleString();
    var datetimespan = document.getElementById("datetimespan");
    
    //alert("curDateTimeStr=" + curDateTimeStr);
    
    if (is_chrome) {
        var daypos = curDateTimeStr.indexOf("GMT");//alert("daypos=" + daypos);
        var shortdt = curDateTimeStr.substr(0,daypos);
        //alert("shortdt=" + shortdt);
        //Thu Apr 09 2009 14:39:01 GMT-0400
    } else {
        //Thu, April 09, 2009 2:35:08 PM

        var daypos = curDateTimeStr.indexOf(',');var day = curDateTimeStr.substr(0,daypos);
        //alert("daypos=" + daypos);alert("day=" + day);

        var shortdt = day.substr(0,3) +  curDateTimeStr.substr(daypos,40);//'Wed, April 08, 2009 9:32:46 PM'
    }
    if (datetimespan) {datetimespan.innerHTML = shortdt;}//curDateTime.toGMTString();
}

function moveindex(cidx){// by clicking next or previous video link on home page, this will work
	//alert(cidx); // 1 - next 2 - prev 3 - current selected video 4 -player size
	//lstbox.items.count 	
	var videolistbox = document.getElementById("selectX");
	var curIdx = videolistbox.selectedIndex; //alert(curIdx);
	var sizelistbox = document.getElementById("sizelist");
	var cursizeIdx = sizelistbox[sizelistbox.selectedIndex].value;
	
	if (cidx == 3) {
		//window.location.href = "index.php?idx=" + (videolistbox.options.length - curIdx) + "&src=lstbox&psize=" + cursizeIdx + "&vtype=" + vtype;
		window.location.href = "index.php?idx=" + videolistbox.options[videolistbox.selectedIndex].value + "&src=lstbox&psize=" + cursizeIdx + "&vtype=" + vtype;		
		
	} else if (cidx == 4) {
		//playgooglevideo("resize");
		resizePlayer();
	} else {
	
		if (cidx == 1) {
			curIdx = curIdx + 1;
			var leftspanmenuobj = document.getElementById("midtd4");clearBoxBorder();
			if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOn;}
		} else {
			var leftspanmenuobj = document.getElementById("midtd5");clearBoxBorder();
			if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOn;}
			curIdx = curIdx - 1;
		}
		if (curIdx >= 0 &&  curIdx < videolistbox.options.length) {
			// Changed to URL is extra burden to the server, but it is increasing the page hits.
			// If we go just by javascript then no need to refresh the page at all, but hit count won't increase.
			// Additional change we could do is : Instead of reading all the videos information just read 3 videos data
			// current , previous and next video.

			//videolistbox.selectedIndex = curIdx;
			//playgooglevideo();
			//window.location.href = "index.php?idx=" + (videolistbox.options.length - curIdx) + "&src=nxtprv";
			window.location.href = "index.php?idx=" + (videolistbox.options.length - curIdx) + "&src=nxtprv" + "&psize=" + cursizeIdx;			

		} else {
			setClearMsgTimer(msgTypeInf,"You have already reached videos list starting/ending.<br><br>");
		}
	}
}
//

function savetomyvideoslist(){
	//alert('Coming soon...');
	
	 var leftspanmenuobj = document.getElementById("midtd2");clearBoxBorder();
	 	
	if (leftspanmenuobj) { leftspanmenuobj.style.border = boxBorderColorOn;}
	
	
	var videolistbox = document.getElementById("selectX");
	var curIdx = videolistbox.selectedIndex;
	var videoid = videolistbox.options[curIdx].value;
	var videodesc = videolistbox.options[curIdx].text;
	//alert(videoid + videodesc);
	saveToOTVCookie(videoid,videodesc);
}

function showTopLinks1(linkid){


	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var userAgent = navigator.userAgent;
	
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	 	var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (ieversion <=6 ) {
		}
	} else {
		document.write('<span id="T1otvtextlangspan" style="padding-bottom:3px;font-style:normal;font-size:12px;">' + bottomLinks(linkid) + '</span>');
	}
}


function shareButtons(){


}


function isInteger(s) {
 return (s.toString().search(/^-?[0-9]+$/) == 0);
}

function showLangCount(){

	var selLangBox = document.getElementById('selLangBox');
	
	selLangBox.title = selLangBox.options.length + " languages are available - Powered by Google";
	
	//var langdropbox = document.getElementById('langdropbox');
	//langdropbox.title = selLangBox.options.length + " languages are available.";
	//return true;
}


var translated = 0;


function changeBtnText(no1){

	var no2 = (no1 % 4);//alert('A');
	var chars_array = new Array("@","#","*","+");
	
	var elSel = document.getElementById("btntranslatespan");
	//alert("1" + elSel.innerHTML);
	elSel.innerHTML = chars_array[no2];
	//alert("2" + elSel.innerHTML);
	//Translate
}

function show_div_border(){
	alert('hi');
}

function initialize(divobjin) {

	 var elSel = document.getElementById('selLangBox');
	 var selIdx = elSel.selectedIndex;
	 var selVal = elSel.options[selIdx].value;

	 var text = divobjin.innerHTML;//alert(text);
	 var innerText ="";
	 if(document.all){
	      innerText = divobjin.innerText;
	 } else{
	     innerText =  divobjin.textContent;
	 }

	 google.language.detect(text, function(result) {
		//alert('A');
		 if (!result.error && result.language) {
			 //google.language.translate(text, result.language, "hi", function(result) {
			//alert('A1');
			 google.language.translate(text, result.language, selVal, function(result) {
				 var translated = document.getElementById("translation");
				 if (result.translation) {
					//alert('A2');
					 //translated.innerHTML = result.translation;
					 divobjin.innerHTML = result.translation;
					 divobjin.title = innerText;
					 
					 addListener(divobjin, 'mouseover', showborder);
					 addListener(divobjin, 'mouseout', hideborder);

				 }
			 });
		 }
	 });
}


//Useage: addListener(window, 'load', myFunction);
// Cross-browser implementation of element.addEventListener()
function addListener(element, type, expression, bubbling)
{
	bubbling = bubbling || false;

	if(window.addEventListener)	{ // Standard
		element.addEventListener(type, expression, bubbling);
		return true;
	} else if(window.attachEvent) { // IE
		element.attachEvent('on' + type, expression);
		return true;
	} else return false;
}
function showborder(e) {
	//var divobj = document.getElementById("div1");
	if (this.style) {
		//this.style.border = "1px solid white";
		this.style.background = "#EFF5F2";
	} else {
		//e.srcElement.style.border="1px solid white";
		e.srcElement.style.background = "#EFF5F2";
	}
}
function hideborder(e) {
	var divobj = document.getElementById("div1");
	if (this.style) {
		//this.style.border = "";
		this.style.background = "";
	} else {
		//alert(e.target); //- works in mozilla
		//alert(e.srcElement); //- works in IE
		//e.srcElement.style.border="";
		e.srcElement.style.background = "";
	}
}


try {
	google.load("language", "1");
} catch(err){
	//Handle errors here
}

function playgooglevideobyidx() {

}

function loginsubmit() {
	setClearMsgTimer(msgTypeInf,"Coming soon...");
}

var randomnumberAdNo = -1;

function changemiddlead() {

   //"maps_small_horizontal_logo.png;169;40;Google Maps is a free web mapping service application, that powers many map-based services."
   //Maximum height of the image could be 50px(see the div tag divmiddleads)
   var middleAds = new Array(
   "aboutlogo.gif;400;35;About.com is an online neighborhood of hundreds of helpful experts, eager to share their wealth of knowledge with visitors.",

   "visitDC.gif;326;48; Visit National Capital - Washington DC, USA",

   "Baltimoread1.gif;361;48; Visit our charm city - Baltimore, MD, USA",

   "visitindia2.gif;234;48;Incredible India - Visit India",

   "newdelhi.gif;353;48; Visit National Capital, New Delhi, India",

   "andhrapradesh.gif;400;48; Visit Hyderabad, Andhra Pradesh, India",

   "yahootravel.gif;259;49;Find cheap airline tickets, hotels, great cruise and vacation packages, honeymoon travel guides, flight information and more, with Yahoo! Travel.",

   	"SourceForge.gif;463;43;Fast, secure and free downloads from the largest Open Source applications and software directory"

   	)
   if (isNaN(randomnumberAdNo)) {randomnumberAdNo = -1;}
   randomnumberAdNo++; if (randomnumberAdNo >= middleAds.length) {randomnumberAdNo = 0;}

   var curMidImg = middleAds[randomnumberAdNo];
   //alert(randomnumberAdNo);alert(curMidImg);

   var curMidImgAry = curMidImg.split(";");
   var imgobj = document.getElementById("middlead0");
   //imgobj.style.display = "block";
	imgobj.src = "images/ads/middle/" + curMidImgAry[0];
	imgobj.width =  curMidImgAry[1];
	imgobj.height =  curMidImgAry[2];
	imgobj.title =  curMidImgAry[3];
	imgobj.alt =  curMidImgAry[3];
}

