/*********************************************************************************************************************
	Version:(1.0.0.1)
	.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.
**********************************************************************************************************************/

var browser=navigator.appName;
//var oPopup = window.createPopup();
var divWidth=2;
var divColor='solid red';

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,Bob,BlrbMode,TagId,Height) {
	//if (oPopup) {
	//	if (oPopup.isOpen) oPopup.hide();
	//}
	//alert('HighLightElement');
	
    var total2Highlight;var divID;var BDivId;
    divID=ob.id;
  //  alert('divID' + divID);
	BDivId=Bob;
	total2Highlight=(document.getElementsByName(ob.id).length);
	//alert('Hi' + total2Highlight );
	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 (BlrbMode == 1) 
						{
							if ( mycount < 1)
							{
						
							    if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
									{
									Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,120,150,150,0);
									}
									else//LESS THAN 60
									{
									Tot_High_Gr_Div_Left_Less_60(BDivId,divID,BlrbMode,mycount,total2Highlight,100,150,50,0)
									}
							 }
						}
						
							document.getElementsByName(divID).item(mycount).style.background="#7cfc00";
				} else {
				
					document.getElementsByName(divID).item(mycount).style.background="blue";
				}//End of (type='art')
			
				document.getElementsByName(divID).item(mycount).style.filter="progid:DXImageTransform.Microsoft.Alpha( Opacity=25 ,FinishOpacity=0, Style=0)";
				
			}//For End
		} else {//For FireFox
			
			for(var mycount=0;mycount<total2Highlight;mycount++){
			//**********Added for Firefox *********************
			
			if (type == "art") 
				{
				if (BlrbMode == 1) 
						{
						if ( mycount < 1)
							{
							    if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
									{
									Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,120,150,150,0);
									}
									else
									{
										Tot_High_Gr_Div_Left_Less_60(BDivId,divID,BlrbMode,mycount,total2Highlight,120,150,150,0);
									//Blurb(BDivId,divID,BlrbMode,mycount,120,150);
									}
							 }
						 }
					}
			//***********End**************
			
				document.getElementsByName(divID).item(mycount).style.border="solid violet 2px";
				}//End for For Firefox
			}
		} 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 (BlrbMode == 1) 
				{
					if ( mycount < 1)
					{
							if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
							{
							Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,120,150,150,0);
							//Blurb(BDivId,divID,BlrbMode,mycount,120,150);
							}
							else
							{
							Tot_High_Gr_Div_Left_Less_60(BDivId,divID,BlrbMode,mycount,total2Highlight,120,150,150,0);
							//Blurb(BDivId,divID,BlrbMode,mycount,120,150);
							}
						}
					}	
				ob.style.background='#7cfc00';
				}
			else
				ob.style.background='blue';
				//********************Added on 10th July to show the blurbs for ads*********************** 
				if ((BlrbMode == 1)&&(TagId='13'))
					{
					if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
								{
								//Blurb(BDivId,divID,BlrbMode,mycount,120,150);
								Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,120,150,150,0)
								}
								else
								{
								Tot_High_Gr_Div_Left_Less_60(BDivId,divID,BlrbMode,mycount,total2Highlight,100,150,50,0)
								//BlurbTopleft(BDivId,divID,mycount,100,150);
								}
						//}
					}
					//******************End**************************
			ob.style.filter="progid:DXImageTransform.Microsoft.Alpha( Opacity=25 ,FinishOpacity=0, Style=0)";
		} else { //For Firefox
		      //alert('firefox');
		
				var mycount=0;
				if (type == "art") 
				{
					//alert(BlrbMode);
				//Code for Blurbs
				if (BlrbMode == 1) 
						{
							if ( mycount < 1)
							{
							    if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
									{
									//Blurb(BDivId,divID,BlrbMode,mycount,200,150);
									Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,200,150,300,0);
									//*******************************************************************
									}
									else
									{
										//Blurb(BDivId,divID,BlrbMode,mycount,350,150);
										Tot_High_Gr_Div_Left_Less_60(BDivId,divID,BlrbMode,mycount,total2Highlight,350,150,500,0);
								}
							 }
						 }
					//**********************End*****************************
					document.getElementsByName(divID).item(mycount).style.border="solid violet 2px";
				}
				else 
				{
					document.getElementsByName(divID).item(mycount).style.border="solid blue 2px";
					//********************Added on 10th July to show the blurbs for ads in Firefox*********************** 
				
				//	if (BlrbMode == 1) 
					if ((BlrbMode == 1)&&(TagId='13'))
					{
						if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
								{
								//Blurb(BDivId,divID,BlrbMode,mycount,120,150);
								Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,120,150,150,0)
								}
								else
								{
									Tot_High_Gr_Div_Left_Less_60(BDivId,divID,BlrbMode,mycount,total2Highlight,100,150,50,0);
								//BlurbTopleft(BDivId,divID,mycount,100,150);
								}
						//}
					}	
					//******************End**************************
			
				}
		}	
	}
}
function HighLightElementPhoto(ob,Bob,BlrbMode,brwsr) {
	//if (oPopup) {
	//	if (oPopup.isOpen) oPopup.hide();
	//}
	var total2Highlight;var divID;var BDivId;

	divID=ob;
	BDivId=Bob;
	total2Highlight=(document.getElementsByName(ob).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;
				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 (BlrbMode == 1) 
				{
				   if ( mycount < 1)
					 {
						if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
						 {
						 Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,130,156,150,0)
						  }
						else//Divid less than 60
						  {
						  Tot_High_Gr_Div_Left_Less_60(BDivId,divID,BlrbMode,mycount,total2Highlight,100,130,150,0);
						  }
					 }
				}	
			}
		} else {
				for(var mycount=0;mycount<total2Highlight;mycount++) {
					document.getElementsByName(divID).item(mycount).style.border="solid violet 2px";
					if (BlrbMode == 1) 
					{
					   if ( mycount < 1)
						 {
							if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
							 {
							 Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,130,156,150,0)
							  }
							else//Divid less than 60
							  {
							  Tot_High_Gr_Div_Left_Less_60(BDivId,divID,BlrbMode,mycount,total2Highlight,100,130,150,0);
							  }
						 }
					}	
				}

		}
	} else {
		if (brwsr == 'ie'){
			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)";
		} else {
			var mycount=0;
			document.getElementsByName(divID).item(mycount).style.border="solid violet 2px";
		}
		if(BlrbMode == 1)
		{
		if (parseInt(document.getElementsByName(divID).item(mycount).style.left)>60)
			{
			 //Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,130,156,150,0)
			//***********************************************************************************
				if (parseInt(document.getElementsByName(divID).item(mycount).style.top)<550)//DivId Top less tha 550
				 {
							//To show the blurbs on top of the Image
					if(document.body.scrollTop<30)
						{
							Blurb(BDivId,divID,BlrbMode,mycount,130,156,0);
						}
					else //ScrollTop greater than 30
						{
							document.getElementsByName(BDivId).item(mycount).style.visibility="hidden"
							BottomBlurb(BDivId,divID,mycount,total2Highlight,150,0);
						}
				  } 
						 //DivId Top >550 and lessthan  700
				 else if((parseInt(document.getElementsByName(divID).item(mycount).style.top)>550) && (parseInt(document.getElementsByName(divID).item(mycount).style.top)< 700))
				   {
						if(document.body.scrollTop<600)
						 {
						 ////alert();
						 ////alert(BDivId);
						  document.getElementsByName(BDivId+'bottom').item(mycount).style.visibility="hidden";
							 Blurb(BDivId,divID,BlrbMode,mycount,130,156,0);
						 }
						else
						{
						////alert();
							document.getElementsByName(BDivId).item(mycount).style.visibility="hidden";
							BottomBlurb(BDivId,divID,mycount,total2Highlight,150,0);
						}
					}	
					else
						{
							Blurb(BDivId,divID,BlrbMode,mycount,120,146,0);
						}	 
			}
			else
			{
			BlurbTopleft(BDivId,divID,mycount,50,146,0);
			}
		}
	}
}
function Tot_High_Gr_Div_Left_Gr_60(BDivId,divID,BlrbMode,mycount,total2Highlight,Blurb_left,Blurb_top,BottomBlurb_left,BottomBlurb_top)
{

//alert('ratna');

	if (parseInt(document.getElementById(divID).style.top)<550)
	 {
		  if(document.body.scrollTop<30)
			{
			  //alert('Blurb');
				Blurb(BDivId,divID,BlrbMode,mycount,Blurb_left,Blurb_top,total2Highlight);
			}
		else
		   {
			document.getElementById(BDivId).style.visibility="hidden"
			//BottomBlurb(BDivId,divID,mycount,total2Highlight,150,0)
			BottomBlurb(BDivId,divID,mycount,total2Highlight,BottomBlurb_left,BottomBlurb_top)
			}	
	}	
	else if((parseInt(document.getElementById(divID).style.top)>550) && (parseInt(document.getElementById(divID).style.top)< 780))
	{
			if(document.body.scrollTop<500)
		 {
			document.getElementById(BDivId+'bottom').style.visibility="hidden";
			//Blurb(BDivId,divID,BlrbMode,mycount,120,150);
			Blurb(BDivId,divID,BlrbMode,mycount,Blurb_left,Blurb_top,total2Highlight);
		 }
		else
		{
		
		document.getElementById(BDivId).style.visibility="hidden";
	//	BottomBlurb(BDivId,divID,mycount,total2Highlight,150,0);
		BottomBlurb(BDivId,divID,mycount,total2Highlight,BottomBlurb_left,BottomBlurb_top);
		}
	}
	else
	{
		//Blurb(BDivId,divID,BlrbMode,mycount,120,150);
		Blurb(BDivId,divID,BlrbMode,mycount,Blurb_left,Blurb_top,total2Highlight);
	}
																     
}
function Tot_High_Gr_Div_Left_Less_60(BDivId,divID,BlrbMode,mycount,total2Highlight,BlurbTopleft_left,BlurbTopleft_top,BottomBlurb_left,BottomBlurb_top)
{
	//alert('ratnaless')
  if (parseInt(document.getElementById(divID).style.top)<550)
   {
		if(document.body.scrollTop<30)
		{
			//BlurbTopleft(BDivId,divID,mycount,100,150);
			BlurbTopleft(BDivId,divID,mycount,BlurbTopleft_left,BlurbTopleft_top,total2Highlight);
		}
		else
		{
			document.getElementById(BDivId).style.visibility="hidden"
			//BottomBlurb(BDivId,divID,mycount,total2Highlight,50,0);
			BottomBlurb(BDivId,divID,mycount,total2Highlight,BottomBlurb_left,BottomBlurb_top);
		}	
	}	
  else if((parseInt(document.getElementById(divID).style.top)>550) && (parseInt(document.getElementById(divID).style.top)< 800))
	{
			if(document.body.scrollTop<600)
		 {
			document.getElementById(BDivId+'bottom').style.visibility="hidden";
			//BlurbTopleft(BDivId,divID,mycount,100,150);
			BlurbTopleft(BDivId,divID,mycount,BlurbTopleft_left,BlurbTopleft_top,total2Highlight);
		 }
		else
		 {
		   document.getElementById(BDivId).style.visibility="hidden";
		   //BottomBlurb(BDivId,divID,mycount,total2Highlight,50,0);
		   BottomBlurb(BDivId,divID,mycount,total2Highlight,BottomBlurb_left,BottomBlurb_top);
		 }
	}
  else
	{
	   //BlurbTopleft(BDivId,divID,mycount,100,150);
	   BlurbTopleft(BDivId,divID,mycount,BlurbTopleft_left,BlurbTopleft_top,total2Highlight);
	}
	//*************************************************************************************************************										
									
}

function Blurb(BDivId,divID,BMode,mycount,left,Top,total2Highlight)
{
//alert('total2Highlight'+total2Highlight);
//alert(BDivId);
	document.getElementById(BDivId).style.visibility="visible";
		//alert(parseInt(document.getElementsByName(divID).item(mycount).style.left)-left);
	//alert(parseInt(document.getElementsByName(divID).item(mycount).style.left)-left);
	if(parseInt(document.getElementsByName(divID).item(mycount).style.left)-left<0)
	{
				//alert('if');;
	document.getElementById(BDivId).style.left=-20+'px';
	}
	else
	{
		//alert('else');
	document.getElementById(BDivId).style.left=parseInt(document.getElementsByName(divID).item(mycount).style.left) -left+'px';
	}
	document.getElementById(BDivId).style.top=parseInt(document.getElementsByName(divID).item(mycount).style.top)-Top+'px';
 
}
function BottomBlurb(BDivId,divID,mycount,total2Highlight,left,Top)
{
	document.getElementById(BDivId+'bottom').style.visibility="visible";
	document.getElementById(BDivId+'bottom').style.left=parseInt(document.getElementsByName(divID).item(total2Highlight-1).style.left)+parseInt(document.getElementsByName(divID).item(total2Highlight-1).style.width)-left +'px';
	document.getElementById(BDivId+'bottom').style.top=parseInt(document.getElementsByName(divID).item(total2Highlight-1).style.top)+parseInt(document.getElementsByName(divID).item(total2Highlight-1).style.height)+'px';

}
function BlurbTopleft(BDivId,divID,mycount,left,top,total2Highlight) //if left less than 60
{
	//alert(BlurbTopleft);
	document.getElementById(BDivId).style.visibility="visible";
	if(parseInt(document.getElementsByName(divID).item(mycount).style.left) +parseInt(document.getElementsByName(divID).item(mycount).style.width)-left<0)
	{
	document.getElementById(BDivId).style.left=-20+'px';
	}
	else
	{
	document.getElementById(BDivId).style.left=parseInt(document.getElementsByName(divID).item(mycount).style.left) +parseInt(document.getElementsByName(divID).item(mycount).style.width)-left+'px';
	}
	document.getElementById(BDivId).style.top=parseInt(document.getElementsByName(divID).item(mycount).style.top)-top+'px';
}
function ClearElementPhoto(ob,Bob,brwsr,ShowBlurb) {
	var total2Highlight;var divID;var BDivId;
	divID=ob;
	BDivId=Bob;
	
	total2Highlight=(document.getElementsByName(ob).length);
	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;
				document.getElementsByName(BDivId).item(mycount).style.visibility="hidden";
				document.getElementsByName(BDivId+'bottom').item(mycount).style.visibility="hidden";
			}
		} else {
			for(var mycount=0;mycount<total2Highlight;mycount++) {
				if (mycount<1) {
					document.getElementById(BDivId).style.visibility="hidden";
					document.getElementById(BDivId+'bottom').style.visibility="hidden";
				}
				document.getElementsByName(divID).item(mycount).style.border="solid white 0px";	
			}
		}
	} else {
		if (brwsr == 'ie') {
			document.getElementsByName(divID).item(mycount).style.background=oldackgroung;
			document.getElementsByName(divID).item(mycount).style.filter=oldfilter;
			document.getElementsByName(BDivId).item(mycount).style.visibility="hidden";
			document.getElementsByName(BDivId+'bottom').item(mycount).style.visibility="hidden";
		} else {
			document.getElementsByName(divID).item(mycount).style.border="solid white 0px";
			document.getElementById(BDivId).style.visibility="hidden";
			document.getElementById(BDivId+'bottom').style.visibility="hidden";
		}
	}
}

function ClearElement(ob,brwsr,Bob,TagId,ShowBlurb) {
	var total2Highlight
	var divID
	var BDivId
	BDivId=Bob;
	divID=ob.id;
	total2Highlight=(document.getElementsByName(ob.id).length);
	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;
				if(ShowBlurb!=0)
			{
				if (mycount<1)
				{
				document.getElementById(BDivId).style.visibility="hidden";
				document.getElementById(BDivId+'bottom').style.visibility="hidden";
				}
				}
			}
		} else {//For firefox
			for(var mycount=0;mycount<total2Highlight;mycount++) {
			if (mycount<1)
			{
			document.getElementById(BDivId).style.visibility="hidden";
			document.getElementById(BDivId+'bottom').style.visibility="hidden";
			}
				document.getElementsByName(divID).item(mycount).style.border="solid white 0px";	
			}//End For

		}
	} else {
	//alert(TagId);
	//alert(Bob);
	//alert(ob);
	//alert();
		if (brwsr == 'ie') {
			ob.style.background=oldackgroung;
			ob.style.filter=oldfilter;	
			var Bobval=Bob;
			//if(Bobval=='Link')
			//{}
			if(ShowBlurb!=0)
			{
			if((TagId=='13')||(Bobval!='Link'))
			{
			document.getElementsByName(BDivId).item(mycount).style.visibility="hidden";
			//document.getElementById(BDivId).style.visibility="hidden";
			document.getElementsByName(BDivId+'bottom').item(mycount).style.visibility="hidden";
			}
			}
		} else {
		

				for(var mycount=0;mycount<total2Highlight;mycount++) {
			if (mycount<1)
			{
			document.getElementById(BDivId).style.visibility="hidden";
			document.getElementById(BDivId+'bottom').style.visibility="hidden";
			}
				document.getElementsByName(divID).item(mycount).style.border="solid white 0px";	
			}//End For
		}
	}
}
function glowArticle(art1,brwsr) {
	var totalDivs;
	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";
		}	
	}
}


//Function used to close the opened div
function CloseElement(ob){
	document.all.ShowArt.style.visibility="hidden";
}
obPage={};
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);
}
obPage.Init();
obPage.bodyHeight=function(win){win=win?win:window; return parseInt(obPage.isIE?win.document.body.clientHeight:win.innerHeight)};

function ldDefThumbs(no) {
obPage.Init();
	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;
	}
}
function TScroll(no) {
	obPage.Init();
	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);
		if(thmbImgtop > pgHght)
		return;
		if(thmbImgtop + img.offsetHeight > 0){
			img.src=img.getAttribute("actImg");
			img.loaded=true;
		}
	}
}

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;
		}
	}
	return result;

}

//Function used to close the opened div
/*function CloseElement(ob){
	document.all.ShowArt.style.visibility="hidden";
}
obPage={};
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);
}
obPage.Init();
obPage.bodyHeight=function(win){win=win?win:window; return parseInt(obPage.isIE?win.document.body.clientHeight:win.innerHeight)};


function ldDefThumbs(no) {
	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;
	}
}
function TScroll(no) {
	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);
		if(thmbImgtop > pgHght)
		return;
		if(thmbImgtop + img.offsetHeight > 0){
			img.src=img.getAttribute("actImg");
			img.loaded=true;
		}
	}
}

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;
		}
	}
	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;
	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);
		}
			
	}
	return (flshInstalled);
}
//play flash on click
function openFlash(strFilePath){
	//alert(strFilePath);
	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.");
	}	
}
function checkPlay() {
	if (myMovieName.IsPlaying()) {
		setTimeout('checkPlay()',2000);
	} else {
		myMovieName.Stop();
		moveflash();
	}
}

function moveflash() {
	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);
	}
}
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 sendFeedbackNIE() {
	var mFdback = "NIEfeedback.aspx";
	window.open(mFdback,"myFeedback","width=470,height=325,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}

function sendFeedbackNIETechnical() {
	var mFdback = "NIETechnicalIssues.aspx";
	window.open(mFdback,"myFeedback","width=470,height=325,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}

function sendFeedbackNIEPassword() {
	var mFdback = "NIEPasswordIssues.aspx";
	window.open(mFdback,"myFeedback","width=470,height=325,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}

 
function sendFeedback() {
	var mFdback = "feedback.aspx";
	window.open(mFdback,"myFeedback","width=470,height=325,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}

function sendFeedbackTechnical() {
	var mFdback = "TechnicalIssues.aspx";
	window.open(mFdback,"myFeedback","width=470,height=325,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}
function sendFeedbackPassword() {
	var mFdback = "PasswordIssues.aspx";
	window.open(mFdback,"myFeedback","width=470,height=325,toolbar=no,menubar=no,address=no,scrollbars=yes,resizable=yes");
}
function sendFeedbackBilling() {
	var mFdback = "BillingIssues.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");
}
