/*********************************************************************************************************************
.js file for the DispPage.asp, containing the following functions.
	
	1.  HighLightELement			- For highlighting Articles,Ads - on mouseover.
	2.  loadPage					- Verifying the browser version, if < 5.5, redirect to error.asp with download option.
	3.  HighLightElementPhoto		- For highlighting Photos - on mouseover.
	4.  ClearElementPhoto			- For clearing the Highlight elements for a photo.
	5.  ClearElement				- For clearing the Highlight elements for articles,Ads.
	8.  glowArticle					- When queried from search results, while showing the page, highlight the article that has been returned.
**********************************************************************************************************************/
//For Rightclick
var currentArticle;
var currentPhoto;       //khaleel
var currentURL;
var CurrentAdvertiser;
var currentArticleName;
var browser=navigator.appName;
var oldackgroung;
//var oPopup = window.createPopup();
var divWidth=2;
var divColor='solid red';
var routTInt;

function loadPage() {
		version=0
		if (navigator.appVersion.indexOf("MSIE")!=-1){
			temp=navigator.appVersion.split("MSIE")
			version=parseFloat(temp[1])
			if (version<5.5) 
				parent.window.location.href = "error.asp?errNumb=20"
		}
}
//puts the image glow
function HighLightElement(ob,type,brwsr,Title,Mode,Id,Email) {
	//if routTInt 
	   clearTimeout(routTInt);

	   cMenu.hide();
	   var total2Highlight;var divID;
    	divID=ob.id;
    	currentArticle=divID;
    	try{
				currentArticleName=document.getElementById(currentArticle).getAttribute("ArticleName")
				CurrentAdvertiser=Email;
				currentURL=Id;
				//alert(disprev);
				
					if(Email!='')
					{
						document.getElementById('adv').disabled=false;
						document.getElementById('adv').style.cursor="hand";
					}
					else
					{
						document.getElementById('adv').disabled=true;
						document.getElementById('adv').style.cursor="none"
					}
				       
					if(Id!='')
					{
						document.getElementById('Viurl').disabled=false;
						document.getElementById('Viurl').style.cursor="hand";
					}
					else
					{
						document.getElementById('Viurl').disabled=true;
						document.getElementById('Viurl').style.cursor="none"
					}
					if(currentArticleName!=null)
						{
							document.getElementById('readOut').disabled=false;
							document.getElementById('readOut').style.cursor="hand";
						}
						else{
							document.getElementById('readOut').style.cursor="none"
							document.getElementById('readOut').disabled=true;
						}

	//For Right click
					total2Highlight=(document.getElementsByName(ob.id).length);
					if (total2Highlight > 1) {
							if (brwsr == 'ie') {
							for(var mycount=0;mycount<total2Highlight;mycount++) {
								oldackgroung=document.getElementsByName(divID).item(mycount).style.background;
								oldfilter=document.getElementsByName(divID).item(mycount).style.filter;
								if (type == "art") {
								if (Mode == 1) 
										{
											if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
													{
													
													Left_Gr_60(divID,100,30,20,100,Title,brwsr); 
													}
													else//LESS THAN 60 
													{
													Left_Less_60(divID,0,30,20,100,Title,brwsr);
													}
							}
									document.getElementsByName(divID).item(mycount).style.background="#7cfc00";
								} else {
									document.getElementsByName(divID).item(mycount).style.background="blue";
								}
								document.getElementsByName(divID).item(mycount).style.filter="progid:DXImageTransform.Microsoft.Alpha( Opacity=25 ,FinishOpacity=0, Style=0)";
							}
						} else {//For firefox
							for(var mycount=0;mycount<total2Highlight;mycount++){
								if (Mode == 1) 
									{
							if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
													{
													Left_Gr_60(divID,956,30,500,100,Title,brwsr); 
													}
													else//LESS THAN 60 
													{
													Left_Less_60(divID,956,30,1000,100,Title,brwsr);
													}
								
								}
								document.getElementsByName(divID).item(mycount).style.border="solid violet 2px";
							}
						}
					} else {//	(if total2Highlight lessthan 1)
						if (brwsr == 'ie') {
							oldackgroung=document.getElementsByName(divID).item(mycount).style.background;
							oldfilter=document.getElementsByName(divID).item(mycount).style.filter;
							if (type =="art")
							{
								if (Mode == 1) 
								{
											if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
													{
													Left_Gr_60(divID,100,30,20,100,Title,brwsr); 
													}
													else//LESS THAN 60 
													{
													Left_Less_60(divID,0,30,20,100,Title,brwsr);
											}
										
									}	
								ob.style.background='#7cfc00';
								}
							else
								ob.style.background='blue';
							ob.style.filter="progid:DXImageTransform.Microsoft.Alpha( Opacity=25 ,FinishOpacity=0, Style=0)";
						} else {//For firefox
								var mycount=0;
								if (type == "art") 
								/*if (BlrbMode == 1) 
								{
											if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
													{
													Left_Gr_60(divID,BlrbMode,mycount,1200,30,0,100,Title,total2Highlight); 
													}
													else//LESS THAN 60 
													{
													Left_Less_60(divID,BlrbMode,mycount,1200,30,0,100,Title,total2Highlight);
													}
										
									}	*/
									document.getElementsByName(divID).item(mycount).style.border="solid violet 2px";
								else 
									document.getElementsByName(divID).item(mycount).style.border="solid blue 2px";
						}	
					}
			}catch(e){}		
}

function Left_Gr_60(divID,left,top,Bleft,Btop,Title,brwsr)
{
		try{
 				if (parseInt(document.getElementById(divID).style.top)<550)
				{
	 					if(document.body.scrollTop<30)
						{
						getElements('Blurb','images/blurb3.gif',brwsr)
						Blurb(divID,left,top,Title,brwsr);
						}
						else
					{
					getElements('Blurb2','images/blurb1.gif',brwsr)
					BottomBlurb(divID,Bleft,Btop,Title,brwsr);
						}	
				}	
				else if((parseInt(document.getElementById(divID).style.top)>550) && (parseInt(document.getElementById(divID).style.top)< 900))
				{
					if(document.body.scrollTop<600)
					{
						getElements('Blurb','images/blurb3.gif',brwsr)
						Blurb(divID,left,top,Title,brwsr);
					}
					else
					{
					getElements('Blurb2','images/blurb1.gif',brwsr);
					BottomBlurb(divID,Bleft,Btop,Title,brwsr);
					}
				}
				else
				{
						getElements('Blurb','images/blurb3.gif',brwsr)
						Blurb(divID,left,top,Title,brwsr);
				}
		}catch(e){}		
																     
}
function Left_Less_60(divID,left,top,Bleft,Btop,Title,brwsr)
{
    try{
				if (parseInt(document.getElementById(divID).style.top)<550)
				{
						if(document.body.scrollTop<30)
						{
						getElements('Blurb','images/blurb4.gif',brwsr)
						BlurbTopleft(divID,left,top,Title,brwsr)
						
						}
						else
						{
						getElements('Blurb2','images/blurb1.gif',brwsr);
						BottomBlurb(divID,Bleft,Btop,Title,brwsr);
						}	
					}	
				else if((parseInt(document.getElementById(divID).style.top)>550) && (parseInt(document.getElementById(divID).style.top)< 900))
					{
	 					if(document.body.scrollTop<600)
						{
							getElements('Blurb','images/blurb4.gif',brwsr);
							BlurbTopleft(divID,left,top,Title,brwsr)
						}
						else
						{

						getElements('Blurb2','images/blurb1.gif',brwsr);
						BottomBlurb(divID,Bleft,Btop,Title,brwsr);
						}
					}
				else
					{
						getElements('Blurb','images/blurb4.gif',brwsr);
						BlurbTopleft(divID,left,top,Title,brwsr)
					}
		}catch(e){}			
	//*************************************************************************************************************										
}


function Blurb(divID,left,top,Title,brwsr)
{
   try{
			setArticleRank(divID)
			document.getElementById("Blurb2").style.visibility="hidden";
			document.getElementById("ArtTitleDiv").innerHTML=Title;
			document.getElementById("Blurb").style.visibility="visible";
			document.getElementById("Blurb").style.display='block';
			//alert(brwsr);
			if(brwsr=='ie')
			{
				if(getLeft(divID)-left<0)
				document.getElementById("Blurb").style.left=-1+'px';
				else
				{
				document.getElementById("Blurb").style.left=getLeft(divID)-left+'px';
				}
				document.getElementById("Blurb").style.top=getTop(divID)-top+'px';
			}
			else
			{
			document.getElementById("Blurb").style.left=getLeft(divID)-800+'px';
			document.getElementById("Blurb").style.top=getTop(divID)-30+'px';
			}
	  }catch(e){}		
}
function setArticleRank(divID)
{
     var artRnkId;
	var temp=divID;
	var temp1;
	var articleWithoutPrefix;
	var intpggrpID_Array;
	try{
			if(temp.indexOf('articlePage')==0){
			articleWithoutPrefix= temp.replace('articlePage','');
			artRnkId='artRnkBlurbarticle'+articleWithoutPrefix+parseInt(sCurrentPage.substring(11,14));
			}
			else if(temp.indexOf('articlep')==0){
				temp1=temp.replace('articlep','');
					intpggrpID_Array=temp1.split("_");
					articleWithoutPrefix=intpggrpID_Array[0];
			}
			else if(temp.indexOf('articler')==0){
				temp1=temp.replace('articler','');
					intpggrpID_Array=temp1.split("_");
					articleWithoutPrefix=intpggrpID_Array[0];
			}
			else{
				articleWithoutPrefix=temp.replace('article','');
			}
			artRnkId='artRnkBlurbarticle'+articleWithoutPrefix+parseInt(sCurrentPage.substring(11,14));
			if (document.getElementById(artRnkId)) {
			document.getElementById("ArtRnkDiv").innerHTML="Article Rank: <img src='" + document.getElementById(artRnkId).innerHTML + "' width='30' height='10'>"
			} else {
			document.getElementById("ArtRnkDiv").innerHTML = "Article Rank: <img src='images/art_rank_0.gif' width='30' height='10'>"
			}
	}catch(e){}	
}
function setBArticleRank(divID)
{
	var temp=divID;
	var temp1;
	var articleWithoutPrefix;
	try{
		if(temp.indexOf('articlePage')==0){
			articleWithoutPrefix= temp.replace('articlePage','');
			}
				else if(temp.indexOf('articlep')==0){
				temp1=temp.replace('articlep','');
					intpggrpID_Array=temp1.split("_");
					articleWithoutPrefix=intpggrpID_Array[0];
				}
			else{
				articleWithoutPrefix=temp.replace('article','');
			}
			var artRnkId;
			artRnkId='artRnkBlurbarticle'+articleWithoutPrefix+parseInt(sCurrentPage.substring(11,14));
			if (document.getElementById(artRnkId)) {
			document.getElementById("BottomArtRnkDiv").innerHTML="Article Rank: <img src='" + document.getElementById(artRnkId).innerHTML + "' width='30' height='10'>"
			} else {
			document.getElementById("BottomArtRnkDiv").innerHTML= "Article Rank: <img src='images/art_rank_0.gif' width='30' height='10'>"
			}
		}catch(e){}	

}

function BottomBlurb(divID,left,top,Title,brwsr)
{
      try{
				setBArticleRank(divID)
				document.getElementById("Blurb").style.visibility="hidden";
				document.getElementById("BottomArtTitleDiv").innerHTML=Title;
				document.getElementById("Blurb2").style.visibility="visible";
				document.getElementById("Blurb2").style.display='block';
				//For iE
				if(brwsr=='ie')
				{
				//document.getElementById("Blurb2").style.left=getRight(divID)+left+'px';
				document.getElementById("Blurb2").style.left=getRight(divID)-20+'px';
				document.getElementById("Blurb2").style.top=getBottom(divID)+top+'px';
				}
				else
				{
					document.getElementById("Blurb2").style.left=getRight(divID)-left+'px';
					document.getElementById("Blurb2").style.top=getBottom(divID)+top+'px';
				}
		}catch(e){}		
}
function BlurbTopleft(divID,left,top,Title,brwsr) //if left less than 60
{
  try{
			setArticleRank(divID);
			document.getElementById("Blurb2").style.visibility="hidden";
			document.getElementById("ArtTitleDiv").innerHTML=Title;
			document.getElementById("Blurb").style.visibility="visible";
				document.getElementById("Blurb").style.display='block';

			if(brwsr=='ie')
			{
				if(getLeft(divID)-left<0)
				{
				document.getElementById("Blurb").style.left=-1+'px';
				}
				else
				{
				document.getElementById("Blurb").style.left=getLeft(divID)-left+'px';
				}
			}	
				
			else
					document.getElementById("Blurb").style.left=getLeft(divID)-left+'px';
				
				document.getElementById("Blurb").style.top=getTop(divID)-top+'px';
	 }catch(e){}			
}	
function HighLightElementPhoto(ob,brwsr,Title,Mode) {

	var total2Highlight;var divID
	divID=ob;
   //For rightclick
   try{
					currentArticle=divID;  
						currentArticleName=null;
					currentArticleName=document.getElementById(currentArticle).getAttribute("ArticleName")
					//For rightclick
					//To disable the readout for photographs

					document.getElementById('readOut').style.cursor="none"
							document.getElementById('readOut').disabled=true;

					total2Highlight=(document.getElementsByName(ob).length);
					if (total2Highlight > 1) {
						for(var mycount=0;mycount<total2Highlight;mycount++) {
							oldackgroung=document.getElementsByName(divID).item(mycount).style.background;
							oldfilter=document.getElementsByName(divID).item(mycount).style.filter;
							document.getElementsByName(divID).item(mycount).style.background="#7cfc00";
							document.getElementsByName(divID).item(mycount).style.filter="progid:DXImageTransform.Microsoft.Alpha( Opacity=25 ,FinishOpacity=0, Style=0)";
							//*****************************************
								if (Mode == 1) // Mode=1 to show blurb
								{
											if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
													{
													Left_Gr_60(divID,100,30,0,100,Title,brwsr); 
													}
													else//LESS THAN 60 
													{
													Left_Less_60(divID,0,30,0,100,Title,brwsr);
													}
								}	
							//*****************************************
						}
					} else {
						oldackgroung=document.getElementsByName(divID).item(mycount).style.background;
						oldfilter=document.getElementsByName(divID).item(mycount).style.filter;
						document.getElementsByName(divID).item(mycount).style.background='#7cfc00';
						document.getElementsByName(divID).item(mycount).style.filter="progid:DXImageTransform.Microsoft.Alpha( Opacity=25 ,FinishOpacity=0, Style=0)";
								//**********************************************
							if (Mode == 1) 
								{
												if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
													{
													Left_Gr_60(divID,100,30,0,100,Title,brwsr); 
													}
													else//LESS THAN 60 
													{
													Left_Less_60(divID,0,30,0,100,Title,brwsr);
													}
												}	
						//*********************************************
					}
		}catch(e){}			
}
function getElements(BlurbId,imgPath,brwsr){
   var BlurbDivElement= document.getElementById(BlurbId); 
     try{
			if (BlurbDivElement.hasChildNodes())
			{
				var TableElement = BlurbDivElement.childNodes;
				if(brwsr=='ie')
				{
					for (var i = 0; i < TableElement.length; i++)   {
						var myrows = TableElement(i).rows;
							var mycells=myrows(i).cells;
						mycells(0).setAttribute('background',imgPath); 
					}
				}
				else
				{
					for (var i = 0; i < TableElement.length; i++)   {
						var myrows = TableElement[i].rows;
						var mycells=myrows[i].cells;
						mycells[0].setAttribute('background',imgPath); 
					}
				  
				}
			}
		}catch(e){}	
 }
 

function ClearElementPhoto(ob) {
	var total2Highlight;var divID;
	divID=ob;
	try{
			total2Highlight=(document.getElementsByName(ob).length);
			if (total2Highlight > 1) {
				for(var mycount=0;mycount<total2Highlight;mycount++) {
				document.getElementById("Blurb").style.visibility="hidden";
						document.getElementById("Blurb2").style.visibility="hidden";
					document.getElementsByName(divID).item(mycount).style.background=oldackgroung;
					document.getElementsByName(divID).item(mycount).style.filter=oldfilter;
				}
			} else {
			document.getElementById("Blurb").style.visibility="hidden";
						document.getElementById("Blurb2").style.visibility="hidden";
				document.getElementsByName(divID).item(mycount).style.background=oldackgroung;
				document.getElementsByName(divID).item(mycount).style.filter=oldfilter;
			}
		}catch(e){}	
}

function ClearElement(ob,brwsr) {
	var total2Highlight
	var divID
	try{
			routTInt = setTimeout("cMenu.hide()", 20000);
			divID=ob.id;
			total2Highlight=(document.getElementsByName(ob.id).length);
			document.getElementById("Blurb").style.visibility="hidden";
						document.getElementById("Blurb2").style.visibility="hidden";
			if (total2Highlight > 1) {
				if (brwsr == 'ie') {
					for(var mycount=0;mycount<total2Highlight;mycount++) {
					
						document.getElementsByName(divID).item(mycount).style.background=oldackgroung;
						document.getElementsByName(divID).item(mycount).style.filter=oldfilter;
					}
				} else {
					for(var mycount=0;mycount<total2Highlight;mycount++) 
					
						document.getElementsByName(divID).item(mycount).style.border="solid white 0px";	
				}
			} else {
			document.getElementById("Blurb").style.visibility="hidden";
						document.getElementById("Blurb2").style.visibility="hidden";
				if (brwsr == 'ie') {
							ob.style.background=oldackgroung;
					ob.style.filter=oldfilter;
				} else {
					document.getElementsByName(divID).item(mycount).style.border="solid white 0px";
				}
			}
	 } catch(e){}		
}
function glowArticle(art1,brwsr) {
	var totalDivs;
	try{
		totalDivs=(document.getElementsByName(art1).length);
		if (totalDivs > 1) {
			if (brwsr == 'ie') {
				for(var mycount=0;mycount<totalDivs;mycount++) {
					document.getElementsByName(art1).item(mycount).style.background='rgb(255,125,255)';
					document.getElementsByName(art1).item(mycount).style.filter="progid:DXImageTransform.Microsoft.Alpha( Opacity=25 ,FinishOpacity=0, Style=0)";
				}
			} else {
				for(var mycount=0;mycount<totalDivs;mycount++)
					document.getElementsByName(art1).item(mycount).style.border="solid pink 2px";
			}
		} else {
			if (brwsr == 'ie') {
				eval("document.getElementById('"+ art1 +"').style.background ='rgb(255,125,255)'");
				document.getElementById(art1).style.filter="progid:DXImageTransform.Microsoft.Alpha( Opacity=25 ,FinishOpacity=0, Style=0)";
			} else {
				var mycount = 0;
				document.getElementsByName(art1).item(mycount).style.border="solid pink 2px";
			}	
	   }
	  }catch(e){}
}


//Function used to close the opened div
function CloseElement(ob){
	document.all.ShowArt.style.visibility="hidden";
}
obPage={};
obZ={};
obPage.Init=function(){
	var bwTyp=this;
	var uAgnt=navigator.userAgent;
	bwTyp.isIE=(uAgnt.indexOf("MSIE")>0);
	bwTyp.isMac=(uAgnt.indexOf("Mac")>0);
	bwTyp.isNS=(uAgnt.indexOf("Gecko")>0);
	bwTyp.isOpera=(window.opera||uAgnt.indexOf("Opera")>0);
	bwTyp.isSafari=(uAgnt.indexOf("Safari")>0);
}
obZ.Init=function(){
	var bwTyp=this;
	var uAgnt=navigator.userAgent;
	bwTyp.isIE=(uAgnt.indexOf("MSIE")>0);
	bwTyp.isMac=(uAgnt.indexOf("Mac")>0);
	bwTyp.isNS=(uAgnt.indexOf("Gecko")>0);
	bwTyp.isOpera=(window.opera||uAgnt.indexOf("Opera")>0);
	bwTyp.isSafari=(uAgnt.indexOf("Safari")>0);
}

obPage.Init();
obZ.Init();
obPage.bodyHeight=function(win){win=win?win:window; return parseInt(obPage.isIE?win.document.body.clientHeight:win.innerHeight)};
obZ.bodyHeight=function(win){win=win?win:window; return parseInt(obZ.isIE?win.document.body.clientHeight:win.innerHeight)};
obZ.scrollTop=function(win){win=win?win:window; return obZ.isIE?win.document.body.scrollTop :win.pageYOffset};
obZ.scrollLeft=function(win){win=win?win:window; return obZ.isIE?win.document.body.scrollLeft:win.pageXOffset};


function ldDefThumbs(no) {
   try{
			for (i=0;i<no;i++) {
				var img = document.getElementById("imgThumb" + (i+1));
				if(!img || img.loaded)continue;
				img.src=img.getAttribute("actImg");
				img.loaded=true;
			}
	  }catch(e){}		
}
function TScroll(no) {
  try{
		var pgHght = obPage.bodyHeight();
		for (i=0;i<no;i++) {
			var img = document.getElementById("imgThumb" + (i+1));
			if(!img || img.loaded)continue;
			var thmbImgtop = obPage.getGlobalY(img);
			//alert(thmbImgtop + '-' + img.id + pgHght);
			if(thmbImgtop > pgHght)
			return;
			if(thmbImgtop + img.offsetHeight > 0){
				img.src=img.getAttribute("actImg");
				img.loaded=true;
			}
		}
	}catch(e){}	
}
//Ravi For Zoom
function TScroll1(no) {
	//alert(setDblclick);
	try{
		var bh = obZ.bodyHeight();
		for (i=0;i<=no;i++) {
			var img1 = document.getElementById("imgcrop" + (i));
			if(!img1 || img1.loaded)continue;
			var top = obZ.getGlobalY(img1);
			if(top > bh)
				return;
			if(top + img1.offsetHeight > 0){
				img1.src=img1.getAttribute("actImg");
				img1.loaded=true;
			}
		}
	 }catch(e){}	
}

obPage.getGlobalY=function(tImg){
	var tObj = this;
	var result=0;
	if (tObj.isOpera){
		while(tImg){
			result+=tImg.offsetTop;
			if(tImg.scrollTop && tImg.scrollTop != tImg.offsetTop)result -= tImg.scrollTop;
			tImg=tImg.offsetParent;
		}
	}else{
		while(tImg){
			result+=tImg.offsetTop;
			if(tImg.scrollTop)result-=tImg.scrollTop;
			tImg=tImg.offsetParent;
			//tImg=document.getElementById("divZoom");
		}
	}
	
	return result;

}
obZ.getGlobalY=function(tImg){
	var tObj = this;
	var result=0;
	if (tObj.isOpera){
		while(tImg){
			result+=tImg.offsetTop;
			if(tImg.scrollTop && tImg.scrollTop != tImg.offsetTop)result -= tImg.scrollTop;
			tImg=tImg.offsetParent;
		}
	}else{
		while(tImg){
			result+=tImg.offsetTop;
			if(tImg.scrollTop)result-=tImg.scrollTop;
			tImg=tImg.offsetParent;
		}
	}
	return result;

}

function openURL(strPageName){
	window.open(strPageName,"mywin")
}
function openMail(strTo) {
	var mUrl = "mailTo.aspx?toadd=" + strTo;
	window.open(mUrl,"myMail","width=580,height=350,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}
function openMultiMedia(strFilePath){
	var vidPath = "showVideo.asp?file=" + strFilePath;
	window.open(vidPath,"myMedia","width=540,height=400,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes")
}
function openFeedback(strPageName){
	window.open(strPageName,"mywin","width=450,height=300,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=no")
}
function openTour(strPageName){
	window.open(strPageName,"mywin")
}
function openOpinion() {
	var mOp = "Opinion.asp";
	window.open(mOp,"myOpinion","width=200,height=210,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}
function openForm() {
	var mfrm = "onlineForm.asp";
	window.open(mfrm,"myForm","width=380,height=410,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}

function checkflashinstalled() {

	var flshInstalled;
	try{
		for(var i=7; i>0; i--){
			flashVersion = 0;
			try{
				var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
				flashVersion = i;
				flshInstalled = 0;
				return (0);
			}
			catch(e){
				flshInstalled = 1;
				//alert(e);
			}
				
		}
	 }catch(e){}	
	return (flshInstalled);
}
//play flash on click
function openFlash(strFilePath){
	
	try{
			if (checkflashinstalled() == 0 ) {
				var xFlsh = (document.body.offsetWidth)/2 + document.body.scrollLeft;
				var yFlsh = (document.body.offsetHeight - 350)/2 + document.body.scrollTop;
				
				flshMovie.style.display='block';
				
				
				flshMovie.style.top = yFlsh ;
				flshMovie.style.left = document.getElementById("divPgSrc").offsetLeft
				
				myMovieName.width = "600px";
				flshMovie.width = 600;
				
				
				myMovieName.movie = strFilePath;
				myMovieName.stop();
				myMovieName.play();
				
				closeflash.style.display = 'block';
				closeflash.style.left = parseInt(flshMovie.style.left) + parseInt(flshMovie.width) -20;
				closeflash.style.top = parseInt(flshMovie.style.top) + 5 + 'px';
				if(strFilePath.indexOf("adnew.swf")== -1){
					checkPlay();
				}
			} else {
				//alert("The application requires flash to be installed.");
			}	
		}catch(e){}	
}
function checkPlay() {
	if (myMovieName.IsPlaying()) {
		setTimeout('checkPlay()',2000);
	} else {
		myMovieName.Stop();
		moveflash();
	}
}

function moveflash() {
  try{
			if ((parseInt(flshMovie.style.top) + 100) >= document.body.offsetHeight) {
				CloseFlashFile();
			} else {
				flshMovie.style.left = parseInt(flshMovie.style.left) + 5 + 'px';
				flshMovie.style.top = parseInt(flshMovie.style.top) + 5 + 'px';
				if (flshMovie.width > 50) {
					myMovieName.width = parseInt(myMovieName.width) - 5;
					flshMovie.width = parseInt(flshMovie.width) - 5;
				}
				setTimeout('moveflash()',0);
			}
	  }catch(e){}		
}
function playAudio(strFilePath){
	audPlayStp.style.display="block";
	//myMediaPlayer.stop();
	myMediaPlayer.filename = strFilePath;
}
function audioPlay() {
	var playStatus = myMediaPlayer.playState;
	if (playStatus == 0) myMediaPlayer.play();
	else if (playStatus == 1) myMediaPlayer.play();
}
function audioPause() {
	var playStatus = myMediaPlayer.playState;
	if (playStatus == 2) {
	  myMediaPlayer.pause();
	}

}
function CloseFlashFile() {
	myMovieName.stop();
	flshMovie.style.display = 'none';
	closeflash.style.display = 'none';
}
function myMovieName_DoFSCommand(command, args) { 
	if (command == "CloseFlashFile") { 
		//alert("Here's the Flash message: " + args[0]);
		CloseFlashFile();
	}
}
 
function sendFeedback() {
	if (chck == "False") {
			window.location.href = "Login.aspx";
			return false;
		}
	var mFdback = "feedback.aspx";
	window.open(mFdback,"myFeedback","width=470,height=325,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}
function showHelp(){
	window.open("HT-help/indexHelp.htm","myFeedback","width=775,height=525,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}
function getLeft(ide){
  try{
				var minLeft=10000;
				var total2Highlight;
				var divID;
				divID=ide;
				var temp;
				total2Highlight=(document.getElementsByName(divID).length);
				if (total2Highlight > 1) {
					for(var mycount=0;mycount<total2Highlight;mycount++) {
					temp=parseInt(document.getElementsByName(divID).item(mycount).style.left);
					if(temp < minLeft)
					minLeft=temp ;
				}
				return minLeft;
			}
			else{
				return parseInt(document.getElementsByName(divID).item(0).style.left); 
			}
	}catch(e){}		
}
function getBottom(ide){

	var maxBottom=0;
    var total2Highlight;var divID;
    divID=ide;
	var temp; 
	try{
			total2Highlight=(document.getElementsByName(divID).length);
			if (total2Highlight > 1) {
				for(var mycount=0;mycount<total2Highlight;mycount++) {
				temp=parseInt(document.getElementsByName(divID).item(mycount).style.height)+parseInt(getTop(divID));
				if(temp > maxBottom)
				maxBottom=temp;
			}
			return maxBottom;
			}
			else{
					return parseInt(document.getElementsByName(divID).item(mycount).style.height)+parseInt(getTop(divID)); 
			}
	  }catch(e){}		
}
function getRight(ide) {
	var maxRight=0;
    var total2Highlight;var divID;
    divID=ide;
	var temp;
	try{
			total2Highlight=(document.getElementsByName(divID).length);
			if (total2Highlight > 1) {
				for(var mycount=0;mycount<total2Highlight;mycount++) {
				temp=parseInt(document.getElementsByName(divID).item(mycount).style.width)+parseInt(getLeft(divID));
				if( maxRight < temp)
				maxRight=temp ;
				}
			return maxRight;
			}

			else{
			return parseInt(document.getElementsByName(divID).item(mycount).style.width)+parseInt(getLeft(divID));
			}
		}catch(e){}	
}
function getTop(ide){
	var minTop=100000;
    var total2Highlight;
    var divID;
    divID=ide;
	var temp;
	try{
			total2Highlight=(document.getElementsByName(divID).length);
			if (total2Highlight > 1) {
				for(var mycount=0;mycount<total2Highlight;mycount++) {
					temp=parseInt(document.getElementsByName(divID).item(mycount).style.top);
				if(temp<minTop)
				minTop=temp;
			}
			return minTop;
			}
			else{
			return parseInt(document.getElementsByName(divID).item(0).style.top); 
			}
		}catch(e){}	
}
