/**************EDS_Page_Top js starts here*****************/	
/*var pageTracker = _gat._getTracker("UA-3226813-1");
pageTracker._setLocalRemoteServerMode();
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._initData();
pageTracker._trackPageview();*/

//var userSeg = '<dsp:valueof bean="Profile.assignedSegment" />';
var userSeg = 'remove';
if(userSeg != null && userSeg != '')
{
	Set_Cookie( 'CookieSegment', '', 'Thu,31-Dec-2000 00:00:00 GMT;', '/', '', '' );
}
function Set_Cookie( name, value, expires, path, domain, secure ) 
{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
	//alert(document.cookie);
}
function createCookie(name,value,days){ 
	var date = new Date();
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
	document.cookie = name+'='+value+expires+'; path=/';
}
function readCookie(name) {
	var nameEQ = name + "=";
 	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		
		while (c.charAt(0)==' ') 
		c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) 
		return c.substring(nameEQ.length,c.length);
	}
	 return null;
}

/**************EDS_Page_Top js ends here*****************/	

/**************EDS_PrimaryNav.js starts here*****************/	
/**
 *  File     : EDS_PrimaryNav.js
 *  Author(s)    : Naveen Kumar
 *  Creation Date: Feb 23, 2010
 *  Functionality: This file contains all navigation related js function.
 *  Dependencies : N/A
 *  Copyright    : P&G
 *  Modifications: <Author> <Date> <Description of Modification>
 */

var selectedId = "0";
function changeImageOnMouseOver(id, cdn) {
	if (selectedId != id) {
		var imagePath = cdn + "/pgeds/en_US/data_root/images/cframe/nav_" + id + "_over.gif";
		(document.getElementById(id)).getElementsByTagName("img")[0].src = imagePath;
	}
}
function changeImageOnMouseOut(id, cdn) {
	if (selectedId != id) {
		var imagePath = cdn + "/pgeds/en_US/data_root/images/cframe/nav_" + id + "_off.gif";
		(document.getElementById(id)).getElementsByTagName("img")[0].src = imagePath;
	}
}
function highLightPrimaryTab(id, cdn) {
	selectedId = id;
	var imagePath = cdn + "/pgeds/en_US/data_root/images/cframe/nav_" + id + "_on.gif";
	(document.getElementById(id)).getElementsByTagName("img")[0].src = imagePath;
}

	

// for header logo 
function changeHeaderImageOnMouseOver(id, cdn) {
	if (selectedId != id) {
		var imagePath = cdn + "/pgeds/en_US/data_root/images/cframe/"+ id + "_over.gif";
		(document.getElementById(id)).getElementsByTagName("img")[0].src = imagePath;
	}
}
function changeHeaderImageOnMouseOut(id, cdn) {
	if (selectedId != id) {
		var imagePath = cdn + "/pgeds/en_US/data_root/images/cframe/"+ id + "_off.gif";
		(document.getElementById(id)).getElementsByTagName("img")[0].src = imagePath;
	}
}

/**************DS_PrimaryNav.js ends here*****************/	

/**************global.js starts here*****************/	
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//added by Sujay for validating header section on submit
function ValidateHeaderForm()
{
	var email = (document.getElementById("email")).value;
	var password = (document.getElementById("password")).value;
	
	if(email == "" || password == "")
	{
		//alert("Email & Password fields cannot be left blank");
		return false;
	}
}
//For RSS ToolTip
function tooltip_disp1()
{
	var dv_tooltip = document.getElementById("msg");
    dv_tooltip.style.visibility="visible";
   
}

function tooltip_hide()
{
	var dv_tooltip = document.getElementById("msg");
    dv_tooltip.style.visibility="hidden";
   
}
/**************global.js ends here*****************/	

/**************styleswitch.js starts here*****************/	

var selId="icon_textsize_small";
var manual_or_random="manual" //"manual" or "random"
var randomsetting="7 days" //"eachtime", "sessiononly", or "x days (replace x with desired integer)". Only applicable if mode is random.

//////No need to edit beyond here//////////////

function getCookie(Name) {
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return null
}

function setCookie(name, value, days) {
var expireDate = new Date()
//set "expstring" to either future or past date, to set or delete cookie, respectively
var expstring=(typeof days!="undefined")? expireDate.setDate(expireDate.getDate()+parseInt(days)) : expireDate.setDate(expireDate.getDate()-5)
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}

function deleteCookie(name){
setCookie(name, "moot")
}


function setStylesheet(title, randomize){ //Main stylesheet switcher function. Second parameter if defined causes a random alternate stylesheet (including none) to be enabled
var i, cacheobj, altsheets=[""]
for(i=0; (cacheobj=document.getElementsByTagName("link")[i]); i++) {
if(cacheobj.getAttribute("rel").toLowerCase()=="alternate stylesheet" && cacheobj.getAttribute("title")) { //if this is an alternate stylesheet with title
cacheobj.disabled = true
altsheets.push(cacheobj) //store reference to alt stylesheets inside array
if(cacheobj.getAttribute("title") == title) //enable alternate stylesheet with title that matches parameter
cacheobj.disabled = false //enable chosen style sheet
}
}
if (typeof randomize!="undefined"){ //if second paramter is defined, randomly enable an alt style sheet (includes non)
var randomnumber=Math.floor(Math.random()*altsheets.length)
altsheets[randomnumber].disabled=false
}
return (typeof randomize!="undefined" && altsheets[randomnumber]!="")? altsheets[randomnumber].getAttribute("title") : "" //if in "random" mode, return "title" of randomly enabled alt stylesheet
}

function chooseStyle(styletitle, days , id_Text, cdn){ //Interface function to switch style sheets plus save "title" attr of selected stylesheet to cookie
if (document.getElementById){
setStylesheet(styletitle)
setCookie("mysheet", styletitle, days)
//alert("text_id ::"+text_id);

	//alert("changeTextSizeImageOnClick :"+id_Text + "::"+cdn);
	var imagePath = cdn+"/pgeds/en_US/data_root/images/cframe/icon_textsize_small_off.gif";
	(document.getElementById("icon_textsize_small")).getElementsByTagName("img")[0].src = imagePath;
	var imagePath = cdn+"/pgeds/en_US/data_root/images/cframe/icon_textsize_medium_off.gif";
	(document.getElementById("icon_textsize_medium")).getElementsByTagName("img")[0].src = imagePath;
	var imagePath = cdn+"/pgeds/en_US/data_root/images/cframe/icon_textsize_large_off.gif";
	(document.getElementById("icon_textsize_large")).getElementsByTagName("img")[0].src = imagePath;
	var imagePath = cdn+"/pgeds/en_US/data_root/images/cframe/" + id_Text + "_on.gif";
	(document.getElementById(id_Text)).getElementsByTagName("img")[0].src = imagePath;

	//alert("VALUE 11 ::::"+(document.getElementById(text_id)).getElementsByTagName("img")[0].src);
	//alert("VALUE 22 ::::"+(document.getElementById(text_id)).getElementsByTagName("img")[0].src);
}
}

function indicateSelected(element){ //Optional function that shows which style sheet is currently selected within group of radio buttons or select menu
if (selectedtitle!=null && (element.type==undefined || element.type=="select-one")){ //if element is a radio button or select menu
var element=(element.type=="select-one") ? element.options : element
for (var i=0; i<element.length; i++){
if (element[i].value==selectedtitle){ //if match found between form element value and cookie value
if (element[i].tagName=="OPTION") //if this is a select menu
element[i].selected=true
else //else if it's a radio button
element[i].checked=true
break
}
}
}
}

if (manual_or_random=="manual"){ //IF MANUAL MODE
var selectedtitle=getCookie("mysheet")
if (document.getElementById && selectedtitle!=null) //load user chosen style sheet from cookie if there is one stored
setStylesheet(selectedtitle)
}
else if (manual_or_random=="random"){ //IF AUTO RANDOM MODE
if (randomsetting=="eachtime")
setStylesheet("", "random")
else if (randomsetting=="sessiononly"){ //if "sessiononly" setting
if (getCookie("mysheet_s")==null) //if "mysheet_s" session cookie is empty
document.cookie="mysheet_s="+setStylesheet("", "random")+"; path=/" //activate random alt stylesheet while remembering its "title" value
else
setStylesheet(getCookie("mysheet_s")) //just activate random alt stylesheet stored in cookie
}
else if (randomsetting.search(/^[1-9]+ days/i)!=-1){ //if "x days" setting
if (getCookie("mysheet_r")==null || parseInt(getCookie("mysheet_r_days"))!=parseInt(randomsetting)){ //if "mysheet_r" cookie is empty or admin has changed number of days to persist in "x days" variable
setCookie("mysheet_r", setStylesheet("", "random"), parseInt(randomsetting)) //activate random alt stylesheet while remembering its "title" value
setCookie("mysheet_r_days", randomsetting, parseInt(randomsetting)) //Also remember the number of days to persist per the "x days" variable
}
else
setStylesheet(getCookie("mysheet_r")) //just activate random alt stylesheet stored in cookie
} 

}
//*************************************************

// For text size image
function changeTextSizeImageOnMouseOver(id_Text, cdn) {
var currentId=getCookie("mysheet");

if(currentId=="none"){
selId="icon_textsize_small";
}
if(currentId=="medium-font"){
selId="icon_textsize_medium";
}
if(currentId=="large-font"){
selId="icon_textsize_large";
}
//	alert(selId);
	if (selId != id_Text) {
		var imagePath = cdn + "/pgeds/en_US/data_root/images/cframe/" + id_Text + "_over.gif";
		(document.getElementById(id_Text)).getElementsByTagName("img")[0].src = imagePath;
	}
}
function changeTextSizeImageOnMouseOut(id_Text, cdn) {
	var currentId=getCookie("mysheet");
	if(currentId=="none"){
	selId="icon_textsize_small";
	}
	if(currentId=="medium-font"){
	selId="icon_textsize_medium";
	}
	if(currentId=="large-font"){
	selId="icon_textsize_large";
	}
		if (selId != id_Text) {
			var imagePath = cdn + "/pgeds/en_US/data_root/images/cframe/" + id_Text + "_off.gif";
			(document.getElementById(id_Text)).getElementsByTagName("img")[0].src = imagePath;
		}
}

function changeTextSizeImageOnClick(id_Text, cdn) {
	//alert("changeTextSizeImageOnClick :"+id_Text + "::"+cdn);
	var imagePath = cdn+"/pgeds/en_US/data_root/images/cframe/icon_textsize_small_off.gif";
	(document.getElementById("icon_textsize_small")).getElementsByTagName("img")[0].src = imagePath;
	var imagePath = cdn+"/pgeds/en_US/data_root/images/cframe/icon_textsize_medium_off.gif";
	(document.getElementById("icon_textsize_medium")).getElementsByTagName("img")[0].src = imagePath;
	var imagePath = cdn+"/pgeds/en_US/data_root/images/cframe/icon_textsize_large_off.gif";
	(document.getElementById("icon_textsize_large")).getElementsByTagName("img")[0].src = imagePath;
	var imagePath = cdn+"/pgeds/en_US/data_root/images/cframe/" + id_Text + "_on.gif";
	//alert("imagePath :"+imagePath);
	//alert("VALUE 1 ::::"+(document.getElementById(id_Text)).getElementsByTagName("img")[0].src);
	(document.getElementById(id_Text)).getElementsByTagName("img")[0].src = imagePath;
	//alert("VALUE 2 ::::"+(document.getElementById(id_Text)).getElementsByTagName("img")[0].src);
}
function autoSelectedTextSizeImage(currentId,cdn){
	var selId="icon_textsize_small";
	if(currentId=="none"){
	selId="icon_textsize_small";
	}
	if(currentId=="medium-font"){
	selId="icon_textsize_medium";
	}
	if(currentId=="large-font"){
	selId="icon_textsize_large";
	}
	var imagePath = cdn+"/pgeds/en_US/data_root/images/cframe/"+ selId +"_on.gif";
	(document.getElementById(selId)).getElementsByTagName("img")[0].src = imagePath;
}
/**************styleswitch.js ends here*****************/	
//Drop Down/ Overlapping Content: http://www.dynamicdrive.com
//Last updated: Nov 22nd, 07

/************** dropdowncontent js starts here*****************/	
var dropdowncontent={
 delaybeforehide: 200, //set delay in milliseconds before content box disappears onMouseout (1000=1 sec)
	disableanchorlink: true, //when user clicks on anchor link, should it be disabled?

	getposOffset:function(what, offsettype){
		return (what.offsetParent)? what[offsettype]+this.getposOffset(what.offsetParent, offsettype) : what[offsettype]
	},

	isContained:function(m, e){
		var e=window.event || e
		var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
		while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
		if (c==m)
			return true
		else
			return false
	},

	show:function(anchorobj, subobj, e){
		if (!this.isContained(anchorobj, e)){
			var horizontaloffset=(subobj.dropposition[0]=="left")? -(subobj.offsetWidth-anchorobj.offsetWidth) : 0 //calculate user added horizontal offset
			var verticaloffset=(subobj.dropposition[1]=="top")? -subobj.offsetHeight : anchorobj.offsetHeight //calculate user added vertical offset
			subobj.style.left=this.getposOffset(anchorobj, "offsetLeft") + horizontaloffset + "px"
			subobj.style.top=this.getposOffset(anchorobj, "offsetTop")+verticaloffset+"px"
			subobj.style.clip=(subobj.dropposition[1]=="top")? "rect(auto auto auto 0)" : "rect(0 auto 0 0)" //hide drop down box initially via clipping
			subobj.style.visibility="visible"
			subobj.startTime=new Date().getTime()
			subobj.contentheight=parseInt(subobj.offsetHeight)
			if (typeof window["hidetimer_"+subobj.id]!="undefined") //clear timer that hides drop down box?
				clearTimeout(window["hidetimer_"+subobj.id])
			this.slideengine(subobj, (subobj.dropposition[1]=="top")? "up" : "down")
		}
	},

	curveincrement:function(percent){
		return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
	},

	slideengine:function(obj, direction){
		var elapsed=new Date().getTime()-obj.startTime //get time animation has run
		if (elapsed<obj.glidetime){ //if time run is less than specified length
			var distancepercent=(direction=="down")? this.curveincrement(elapsed/obj.glidetime) : 1-this.curveincrement(elapsed/obj.glidetime)
			var currentclip=(distancepercent*obj.contentheight)+"px"
			obj.style.clip=(direction=="down")? "rect(0 auto "+currentclip+" 0)" : "rect("+currentclip+" auto auto 0)"
			window["glidetimer_"+obj.id]=setTimeout(function(){dropdowncontent.slideengine(obj, direction)}, 10)
		}
		else{ //if animation finished
			obj.style.clip="rect(0 auto auto 0)"
		}
	},

	hide:function(activeobj, subobj, e){
		if (!dropdowncontent.isContained(activeobj, e)){
			window["hidetimer_"+subobj.id]=setTimeout(function(){
				subobj.style.visibility="hidden"
				subobj.style.left=subobj.style.top=0
				clearTimeout(window["glidetimer_"+subobj.id])
			}, dropdowncontent.delaybeforehide)
		}
	},

 init:function(anchorid, pos, glidetime){
		var anchorobj=document.getElementById(anchorid)
		var subobj=document.getElementById(anchorobj.getAttribute("rel"))
		subobj.dropposition=pos.split("-")
		subobj.glidetime=glidetime || 1000
		subobj.style.left=subobj.style.top=0
		anchorobj.onmouseover=function(e){dropdowncontent.show(this, subobj, e)}
		anchorobj.onmouseout=function(e){dropdowncontent.hide(subobj, subobj, e)}
		if (this.disableanchorlink) anchorobj.onclick=function(){return false}
		subobj.onmouseout=function(e){dropdowncontent.hide(this, subobj, e)}
	}
}
/************** dropdowncontent js ends here*****************/	

/************** validate js starts here*****************/	
/*GENERAL METHODS*/
/*Check for Empty String*/
function isEmptyString(chkStr) {
	if (chkStr == "") {
		return true;
	}
	else {
		var numWhiteSpaces = 0;
		for (var i=0; i < chkStr.length; i++) {
			if (chkStr.substring(i, i+1) == " ") {
				numWhiteSpaces++;
			}
		}
		if (numWhiteSpaces == chkStr.length) {
			return true;
		}
		else {
			return false;
		}
	}
}


function matchIgnoreCase(name)   
 {  
   
    var strToTest = "resident"; 
	name = name.toLowerCase();
	
	name=name.replace(/^\s+|\s+$/g, '');
	 
	 
  if(name == strToTest)
   { return false;
    }
  else{
        return true;
      }
 } 

/* This method returns true if it founds any special 
	character(present in the specialCharArray) in the passed string. */
function checkSpecialCharacter(chkStr) 
{

	 var specialCharArray=new Array('~', '!', '%', '^', '*', '+', '=', '{',
     '}', '|', '/', ':', ';', '<', '>', '?', ',', '(', ')', '\\',
     '\'');
    
    for (i = 0; i < specialCharArray.length; i++) 
    {
	    if(chkStr.indexOf(specialCharArray[i])>0)
	    {
	         return true;
	         break;
    	}
   }
}

function checkSpecChars(chkStr) 
{
	var specialCharArray=new Array('|','=','°','@','!','º','\t');
     
    for (i = 0; i < specialCharArray.length; i++) 
    {
	    if(chkStr.indexOf(specialCharArray[i])!= -1)
	    {
	         return false;
    	}
   }
   return true;
}


function alphanumeric(upass_string)
{
var alphaCount=0
 var numCount=0

var num_valid="1234567890"

    for (var i=0; i<upass_string.length; i++) {
        if (num_valid.indexOf(upass_string.charAt(i)) < 0) {
         numCount++
        }
    }
 if(numCount==upass_string.length){


            return false;
   }

var alph_valid="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

    for (var i=0; i<upass_string.length; i++) {
        if (alph_valid.indexOf(upass_string.charAt(i)) < 0) {
            alphaCount++
        }
    }
 if(alphaCount==upass_string.length){
 
            return false;
   }


    special="!@#$%^&*()_~+=?/\|}{][.,:-"

    for (var i=0; i<upass_string.length; i++) {
		  if(upass_string.charAt(i)=='!'||upass_string.charAt(i)=='@'||upass_string.charAt(i)=='#'||upass_string.charAt(i)=='$'||upass_string.charAt(i)=='%'||upass_string.charAt(i)=='^'||upass_string.charAt(i)=='&'||upass_string.charAt(i)=='*'||upass_string.charAt(i)=='('||upass_string.charAt(i)==')'||upass_string.charAt(i)=='_'||upass_string.charAt(i)=='~')
		{
		   return false;
        }
    }

return true;
 }




/*Function to check only Alphabets
function chkAlphabetChr(codeValue)
{
	var validChars1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var validChars2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	
    if(codeValue=="")
        return false;
	
	if (validChars2.indexOf(codeValue.charAt(0))<0)
	{
		return true;
	}
	for(i=0;i<codeValue.length;i++)
    {
		if (validChars1.indexOf(codeValue.charAt(i))<0)
			return true;
	}
}

function chkDigitChr(codeValue)
{
	var validChars1="1234567890";
	var validChars2="1234567890";
	
    if(codeValue=="")
        return false;
	
	if (validChars2.indexOf(codeValue.charAt(0))<0)
	{
		return true;
	}
	for(i=0;i<codeValue.length;i++)
    {
		if (validChars1.indexOf(codeValue.charAt(i))<0)
			return true;
	}
} */

/*function chkAlphabetChr(codeValue)
{
    var flag="true";
    if(codeValue=="")
        return false;
    for(i=0;i<codeValue.length;i++)
    {
    	if(((codeValue.charAt(i)>='A') && (codeValue.charAt(i)<='Z'))||((codeValue.charAt(i)>='a') && (codeValue.charAt(i)<='z')))
        {
    		flag="false";
    	}
        else
        {
            flag="true";
		    break;
        }
    }
    if(flag=="false")
    {
        return false;
    }
    else
    {
        return true;
    }
}*/

/*Function to check valid EMail Address*/
function eMailIDcheck(str) {
  var at="@";
  var dot=".";
  var lat=str.indexOf(at);
  var lstr=str.length;
  var ldot=str.indexOf(dot);
  var specialCharArray=new Array('~', '!', '%', '^', '*', '+', '=', '{',
     '}', '|', '/', ':', ';', '<', '>', '?', ',', '(', ')', '\\',
     '\'');
  if (str.indexOf(at)==-1){
     
     return true;
  }
 
  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
    
     return true;
  }
 
  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
     
      return true;
  }
 
   if (str.indexOf(at,(lat+1))!=-1){
      
      return true;
   }

   if (str.indexOf('..')!=-1){      

      return true;

   }

 
   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
     
      return true;
   }
 
   if (str.indexOf(dot,(lat+2))==-1){
     
      return true;
   }
  
   if (str.indexOf(" ")!=-1){
     
      return true;
   }
 
  for (i = 0; i < specialCharArray.length; i++) {
    if(str.indexOf(specialCharArray[i])>0){
     //alert("Special charecters not allowed");
     return true;
    }
  }
    return false ;    
 }
 
 /*Function to get Current Date*/
/* EXPLANATION FOR WHY 38
Fortunately there is a simple solution to this extremely complex problem. 
Since it is supported by all browsers, always use getYear(). 
Divide the outcome by 100 and take the modulus, so that now we have a number from 0 to 99. 
If this number is smaller than 38, add 2000, if it's larger add 1900. This always gives the correct year.
So always use the function below when you have to calculate a year:
(Why 38? Because Epoch Time will end in 2038. You can also use 
(y > 69) ? 1900: 2000;
because in the Epoch Time system no date can be before 1970).
*/
var Days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var today = new Date();
var Year = takeYear(today);
var Month = leadingZero(today.getMonth()+1);
var DayName = Days[today.getDay()];
var Day = leadingZero(today.getDate());
var Hours = leadingZero(today.getHours());
var Minutes = leadingZero(today.getMinutes());
var Seconds = leadingZero(today.getSeconds());

function takeYear(theDate)
{
	x = theDate.getYear();
	var y = x % 100;
	y += (y < 38) ? 2000 : 1900;
	return y;
}

function leadingZero(nr)
{
	if (nr < 10) nr = "0" + nr;
	return nr;
}


/*Function to check valid Canadian ZIP CODE*/
function isPostCode(entry)
{ 
	strlen = entry.length; if (strlen != 6) {return false;}
	entry=entry.toUpperCase();        // in case of lowercase characters
	// Check for legal characters in string - note index starts at zero
	if ('ABCEHJKLMNPRSTVXY'.indexOf(entry.charAt(0)) < 0) {return false;}
	if ('0123456789'.indexOf(entry.charAt(1)) < 0) {return false;}
	if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2)) < 0) {return false;}
	if ('0123456789'.indexOf(entry.charAt(3)) < 0) {return false;}
	if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(4)) < 0) {return false;}
	if ('0123456789'.indexOf(entry.charAt(5)) < 0) {return false;}
	return true; 
}

/*Function to check valid USA ZIP CODE*/
function validateZIP(field) {
var valid = "0123456789-";
var hyphencount = 0;

if (field.length!=5 && field.length!=10) {
return false;
}
for (var i=0; i < field.length; i++) {
temp = "" + field.substring(i, i+1);
if (temp == "-") hyphencount++;
if (valid.indexOf(temp) == "-1") {
	return false;
}
if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) {
	return false;
   }
}
return true;
}

/*Function to check valid Phone*/
function validatePhone(field) 
{
	var re = /^([0-9]{3}\-){2}[0-9]{4}$/;
	if(!re.test(field))
		return false;
	else
		return true;
}

/*Function to checkboc*/
function checkbox_checker(checkbox)
{
if(checkbox.checked)
 return true;
else 
return false;

}
/*Function to check Radio Button Selection*/
function radio_button_checker(radio_button)
{
	var radio_choice = false;
	for (counter = 0; counter < radio_button.length; counter++)
	{
	// If a radio button has been selected it will return true
	// (If not it will return false)
		if (radio_button[counter].checked)
			radio_choice = true; 
	}
	if (!radio_choice)
	{
	// If there were no selections made display an alert box 
		return (false);
	}
	return (true);
}

function checkEqualString(str1,str2)
{
	if (str1==str2)
	{
		return true
	}
}

function checkAlphaNumeric(codeValue){
	var validChars1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	for(i=0;i<codeValue.length;i++)
    {
		if (validChars1.indexOf(codeValue.charAt(i))<0)
			return false;
	}
	return true;
}

function isNumeric(upass_string){
	var alphaCount=0
	var numCount=0
	var num_valid="1234567890"

	for (var i=0; i<upass_string.length; i++) {
		if (num_valid.indexOf(upass_string.charAt(i)) < 0) {
			numCount++
		}
	}
	if(numCount >0){
		return false;
	}
	return true;
}
function chkAlphaCharacter(codeValue,count) {
 	var numCount=0;
	var validChars1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	for(i=0;i<codeValue.length;i++)  {
		if (validChars1.indexOf(codeValue.charAt(i))<0){
			numCount++;
		}
	}
 	if(numCount >((codeValue.length)-count)){
		return false;
   	}
	return true;
}
/************** validate js ends here*****************/	

/************** page js starts here*****************/	
function checkEmail(str) {

  var at="@";
  var dot=".";
  var lat=str.indexOf(at);
  var lstr=str.length;
  var ldot=str.indexOf(dot);
  var specialCharArray=new Array('~', '!', '%', '^', '*', '+', '=', '{',
     '}', '|', '/', ':', ';', '<', '>', '?', ',', '(', ')', '\\',
     '\'');
  if (str.indexOf(at)==-1){
     return false;
  }
 
  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
    
     return false;
  }
 
  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
     
      return false;
  }
 
   if (str.indexOf(at,(lat+1))!=-1){
      
      return false;
   }
        
   var len =str.substring(ldot,ldot+3);
 
if(len.length<=2) {
return false;
}
   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
     
      return false;
   }
 
   if (str.indexOf(dot,(lat+2))==-1){
     
      return false;
   }
     if (str.indexOf('..')!=-1){      
 
      return false;
 
            }
 
   if (str.indexOf(" ")!=-1){
     
      return false;
   }
 
   if(str.charAt(str.length-1)=='.')
 {
    return false;
 }
  for (i = 0; i < specialCharArray.length; i++) {
    if(str.indexOf(specialCharArray[i])>0){
     return false;
    }
  }
    
 return true ;    
 }

//For required field
function setValue(field, value) {
	var errorDiv = document.getElementById(field);
	errorDiv.innerHTML = value;
}
function doFocus(field) {
	setClass(field, "focused");
	var obj = document.getElementById(field);
	if (obj != null) {
		obj.focus();
	}
}
function setClass(field, className) {
	var obj = document.getElementById(field);
	if (obj != null) {
		obj.className = className;
	}
}
function resetErrorLabel() {
	setValue("e2", "");
	setValue("e3", "");
}
function resetBGColor() {
	setClass("email", "none");
	setClass("checkbox", "none");
}
function emailcheck()
{
	
	var alertMessage = "";
	var errorFound = false;
	var focusElement = "";
	var scrollLocation = 0;
	var e1Value = false;
	resetErrorLabel();
	resetBGColor();
	
	var email=document.getElementById("email").value;
	
	if (isEmptyString(email)) {
		alertMessage = alertMessage + "\n" + "Please enter your e-mail address.";
		setValue("e2", "Please enter your e-mail address.");		
		if (!errorFound) {
			errorFound = true;
			scrollLocation = 750;
			focusElement = "email";
			
		}
		
	} 
else 
	{
		if (eMailIDcheck(email)) {
			alertMessage = alertMessage + "\n" + "Please enter valid e-mail address.";
			setValue("e2", "Please enter valid e-mail address.");			
			if (!errorFound) {
				errorFound = true;
				scrollLocation = 750;
				focusElement = "email";
			}
		}
	}
	if (alertMessage != "") {
		if (focusElement != "") {
			doFocus(focusElement);
		}
		return false;
	}

}
function validate_unsubscribe()
{
	
	var alertMessage = "";
	var errorFound = false;
	var focusElement = "";
	var scrollLocation = 0;
	var e1Value = false;
	resetErrorLabel();
	resetBGColor();
	
	var email=document.getElementById("email").value;
	var checkbox=document.getElementById("checkbox");
	if (isEmptyString(email)) {
		alertMessage = alertMessage + "\n" + "Please enter your e-mail address.";
		setValue("e2", "Please enter your e-mail address.");		
		if (!errorFound) {
			errorFound = true;
			scrollLocation = 750;
			focusElement = "email";
			
		}
		
	} 
else 
	{
		if (eMailIDcheck(email)) {
			alertMessage = alertMessage + "\n" + "Please enter valid e-mail address.";
			setValue("e2", "Please enter valid e-mail address.");			
			if (!errorFound) {
				errorFound = true;
				scrollLocation = 750;
				focusElement = "email";
			}
		}
	}
	if(checkbox.checked)
	 {
	 	//return true;
	 }
	
	else 
	{
		alertMessage = alertMessage + "\n" + "Please select the box to unsubscribe.";
		setValue("e3", "Please select the box to unsubscribe.");		
		if (!errorFound) {
			errorFound = true;
			scrollLocation = 750;
			focusElement = "checkbox";
			
		}
	}
	if (alertMessage != "") {
		if (focusElement != "") {
			doFocus(focusElement);
		}
		return false;
	}

}
/************** page js ends here*****************/

/************** script main js starts here*****************/
var appVer = navigator.appVersion.toLowerCase();
var userAgt = navigator.userAgent.toLowerCase();
var mac = (appVer.indexOf("mac") != -1);
var win = (appVer.indexOf("win") != -1);
var nn = (navigator.appName == "Netscape");
var ie = (navigator.appName == "Microsoft Internet Explorer");
var aol = (userAgt.indexOf("aol") != -1);
var opera = (userAgt.indexOf("opera") != -1);
var v4 = (parseInt(appVer) >= 4);
var ver = (ie) ? parseFloat(appVer.substring((appVer.indexOf('msie') + 5), appVer.length)) : parseFloat(appVer);
var remote;
var URL;


function toSmall(imagename){
	var temp=imagename.replace(/_lrg/g,"_sml");
	temp=temp.replace(/\/med\//g,"/sml/");
	temp=temp.replace(/\/lrg\//g,"/sml/");
	temp=temp.replace(/_med/g,"_sml");
return temp;
}

function toLarge(imagename){
	var temp=imagename.replace(/_sml/g,"_lrg");
	temp=temp.replace(/_med/g,"_lrg");
	temp=temp.replace(/\/med\//g,"/lrg/");
	temp=temp.replace(/\/sml\//g,"/lrg/");
return temp;
}

function brandimage(brandname){
	var temp=brandname;
	temp='/common/image/brought_icons/'+brandname+'.gif';
	return temp;
}

function brandimage(brandname){
	var temp=brandname;
	temp='/common/image/10_common/brought_icons/'+brandname+'.gif';
	return temp;
}

function toSmall(imagename){
	var temp=imagename.replace(/_lrg/g,"_sml");
	temp=temp.replace(/\/med\//g,"/sml/");
	temp=temp.replace(/\/lrg\//g,"/sml/");
	temp=temp.replace(/_med/g,"_sml");
return temp;
}

function toLarge(imagename){
	var temp=imagename.replace(/_sml/g,"_lrg");
	temp=temp.replace(/_med/g,"_lrg");
	temp=temp.replace(/\/med\//g,"/lrg/");
	temp=temp.replace(/\/sml\//g,"/lrg/");
return temp;
}

function brandimage(brandname){
	var temp=brandname;
	temp='/common/image/brought_icons/'+brandname+'.gif';
	return temp;
}


function formHandler1(){
if (nn && v4) {
  var formref = document.prodinfo.document.pinfo;
}
else {
  var formref = document.pinfo;
}
var URL = formref.report.options[formref.report.selectedIndex].value;
window.location.href = URL;
}

function formHandler2(){
if (nn && v4) {
  var formref = document.prodinfo.document.pinfo;
}
else {
  var formref = document.pinfo;
}
var URL = formref.productinfo.options[formref.productinfo.selectedIndex].value;
window.location.href = URL;
}

function formHandler3(){
if (nn && v4) {
  var formref = document.prodinfo.document.pinfo;
}
else {
  var formref = document.pinfo;
}
var URL = formref.fav.options[formref.fav.selectedIndex].value;
window.location.href = URL;
}
function formHandler4(){
if (nn && v4) {
  var formref = document.prodinfo.document.pinfo;
}
else {
  var formref = document.pinfo;
}
var URL = formref.site_feed.options[formref.site_feed.selectedIndex].value;
window.location.href = URL;
}


function stockpop(URL) {
	remote = window.open(URL,"pop","scrollbars=0,toolbar=0,location=0,directories=0,status=0,menubar=0,width=325,height=275,screenX=200,screenY=240,left=200,top=220");
	remote.focus();
        if (remote.opener == null) remote.opener = self;
}

function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()

/*
* FUNCTION: blurLinks
* utitility function for turning off link focus (lines drawn around an active link) in browsers such as ie4Win
*/
function blurLinks() {
if(!document.links || document.links.length <= 0 || !getObj('document.links[0].focus')) return;
  for(var i = 0; i < document.links.length; i++) {
  document.links[i].onfocus = document.links[i].blur;
  }
}



/*
* FUNCTION: swapImg
* Image Swapping function.
*/
function swapImg() {
if(!document.images) return;
//alert('test');
var args = swapImg.arguments;
  for(var i = 0; i < args.length; i+=2) {
  var imgSrc = (args[i + 1].indexOf('[') != -1) ? eval(args[i + 1] + '.src') : args[i + 1];
  if(getImgObj(args[i])) getImgObj(args[i]).src = imgSrc;
  }
}

function getImgObj(name, doc) {
var i, layer, imgs;
  if(!doc) doc = document;

  // retrieve ie dom image or non-layer image
  if(doc.images[name]) return doc.images[name];

  // retrieve nn layer image
  for(var i = 0; i < doc.layers.length; i++) {
  layer = doc.layers[i];
  imgs = layer.document.images;
  if(imgs.length > 0 && imgs[name]) return imgs[name];
  if(layer.document.layers.length > 0) layer = getImgObj(name, layer.document);
  }
return 0;
}

function moveLayer(lyr,t,l) {
eval("csspObj('" + lyr + "').setProperty('top'," + t + ")");
eval("csspObj('" + lyr + "').setProperty('left'," + l + ")");
}

function move1(){
swapImg('flag1','/common/image/flags_0_1.gif');
moveLayer('move','144','7');
}

function move2(){
swapImg('flag2','/common/image/korea_b.gif');
moveLayer('move','165','7');
}

function move3(){
swapImg('flag3','/common/image/flags_2_1.gif');
moveLayer('move','185','7');
}

function move4(){
swapImg('flag4','/common/image/flags_3_1.gif');
moveLayer('move','205','7');
}

function move5(){
swapImg('flag5','/common/image/flags_4_1.gif');
moveLayer('move','226','7');
}

function move6(){
swapImg('flag6','/common/image/flags_5_1.gif');
moveLayer('move','246','7');
}

function move7(){
swapImg('flag7','/common/image/flags_6_1.gif');
moveLayer('move','268','7');
}

function move8(){
swapImg('flag8','/common/image/flags_7_1.gif');
moveLayer('move','289','7');
}

function move9(){
swapImg('flag9','/common/image/flags_8_1.gif');
moveLayer('move','310','7');
}

function move10(){
swapImg('flag10','/common/image/kazakhstan.gif');
moveLayer('move','332','7');
}

function move11(){
swapImg('flag11','/common/image/kyrgyzstan.gif');
moveLayer('move','353','7');
}

function move12(){
swapImg('flag12','/common/image/mongolia.gif');
moveLayer('move','374','7');
}

function move13(){
swapImg('flag13','/common/image/turkmenistan.gif');
moveLayer('move','395','7');
}

function move14(){
swapImg('flag14','/common/image/uzbekistan.gif');
moveLayer('move','416','7');
}

function move15(){
swapImg('flag15','/common/image/russia.gif');
moveLayer('move','438','7');
}

function move16(){
swapImg('flag16','/common/image/ukraine.gif');
moveLayer('move','458','7');
}

function move17(){
swapImg('flag17','/common/image/turkey_b.gif');
moveLayer('move','479','7');
}


/*
* FUNCTION: handleResize
* window reloading function
* refreshs window upon minimizing or maximizing browser window
*/
//if(window.captureEvents) {
//window.captureEvents(Event.RESIZE);
//window.onresize = handleResize;
//window.onresize = reloadPage;
//}
/*
function handleResize() {
location.reload();
return false;
}
*/

//function reloadPage(init) {
//  if (init==true) with (navigator) {
//    if (nn && v4) {
//    document.pgW=innerWidth;
//    document.pgH=innerHeight;
//    onresize=reloadPage;
//    }
//  }
//  else if (innerWidth!=document.pgW || innerHeight!=document.pgH)
//location.reload();
//}
//reloadPage(true);

var onloadHandlers = [];
function loadEvents() {
//if((ver<5) && win && ie) blurLinks();
  for(var i=0; i<onloadHandlers.length;i++) {
  eval(onloadHandlers[i]);
  }
}
window.onload = loadEvents;

var onresizeHandlers = [];
function resizeEvents() {
 for(var i=0; i<onresizeHandlers.length;i++) {
  eval(onresizeHandlers[i]);
  }
}
window.onresize = resizeEvents;

function handleResize(init) {
if(!(nn && v4)) return;
  if(init==true) with (navigator) {
  document.pgW=innerWidth;
  document.pgH=innerHeight;
  onresizeHandlers[onresizeHandlers.length] = 'handleResize()';
  }
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
handleResize(true);

var Params1;

if (document.images != null) {
Params1 = "width=450,height=300,";
}else{
Params1 = "width=425,height=300,";
}
Params1 += "resizable=0,status=0,menubar=0,scrollbars=1,location=1";

function Certify(URL) {
  popupWin = window.open(URL, 'Participant', Params1)
  window.top.name = 'opener';
  popupWin.focus();
}
function formHandler3(){
if (nn && v4) {
  var formref = document.prodinfo.document.pinfo;
}
else {
  var formref = document.pinfo;
}
var URL = formref.site_feed.options[formref.site_feed.selectedIndex].value;
window.location.href = URL;
}

function formHandler(oSelect){
	var pos;
	var URL = oSelect;

	//pos = oSelect.options[oSelect.selectedIndex].value.indexOf('javascript:interrupt_pop(\'');
	//alert('oSelect :' +oSelect + 'URL'+URL);
	if (URL=='View Brand Sites' || URL=='')
	{
		return -1;
	}

	//alert('POS :' +pos);
	/*if (pos == -1) {
 
  		pos = oSelect.options[oSelect.selectedIndex].value.indexOf('javascript:confirms_lang(\'');
  
  if (pos == -1) {
   pos = oSelect.options[oSelect.selectedIndex].value.indexOf('http:');
  
   if (pos == -1) {
 		 window.location.href = URL;
   }
   else {
    window.open(URL);
   }
  }  
  else {
   var ref = getref(URL, pos);
   if (confirm(englishRedirect)) {
    window.open(ref);
   }
  }  
	}
 
	else {
		var ref = getref(URL, pos);
  interrupt_pop(ref);
	}*/
	window.open(URL);
}

function getref(URL, pos) {
	var start = pos+26; //9 is the length of the string that determines pos
	var end = URL.length-3;
	var splitStr = URL.substring(start, end );
	return splitStr;
}



function toMed(imagename){
	var temp=imagename.replace(/_sqr/g,"_med");

return temp;
}

function toSmall(imagename){

	var temp=imagename.replace(/_lrg/g,"_sml");

	temp=temp.replace(/\/med\//g,"/sml/");

	temp=temp.replace(/\/lrg\//g,"/sml/");

	temp=temp.replace(/_med/g,"_sml");

return temp;

}



function toSmall(imagename){
	var temp=imagename.replace(/_lrg/g,"_sml");
	temp=temp.replace(/\/med\//g,"/sml/");
	temp=temp.replace(/\/lrg\//g,"/sml/");
	temp=temp.replace(/_med/g,"_sml");
return temp;
}

function toLarge(imagename){
	var temp=imagename.replace(/_sml/g,"_lrg");
	temp=temp.replace(/_med/g,"_lrg");
	temp=temp.replace(/\/med\//g,"/lrg/");
	temp=temp.replace(/\/sml\//g,"/lrg/");
return temp;
}

function resulst_pop(url) {
	quizWin=window.open(url, "", "toolbar=no,directories=no,status=no,location=0,resizable=no,scrollbars=no,menubar=no,width=300,height=300,screenY=25,screenX=25,top=25,left=25"); 
quizWin.focus();
}

var flashVersion = 0;
function getFlashVersion() {
	var agent = navigator.userAgent.toLowerCase(); 
	
   // NS3 needs flashVersion to be a local variable
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
      flashVersion = 0;
   }
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			if (flashPlugin.description.indexOf('7.') != -1) flashVersion = 7;
			else if (flashPlugin.description.indexOf('6.') != -1) flashVersion = 6;
			else if (flashPlugin.description.indexOf('5.') != -1) flashVersion = 5;
			else if (flashPlugin.description.indexOf('4.') != -1) flashVersion = 4;
			else if (flashPlugin.description.indexOf('3.') != -1) flashVersion = 3;
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	   document.write('<scr' + 'ipt language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('dim obFlash \n');
		document.write('set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") \n');
		document.write('if IsObject(obFlash) then \n');
		document.write('flashVersion = 7 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") end if \n');
		document.write('if flashVersion < 7 and IsObject(obFlash) then \n');
		document.write('flashVersion = 6 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") end if \n');
		document.write('if flashVersion < 6 and IsObject(obFlash) then \n');
		document.write('flashVersion = 5 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.4") end if \n');
		document.write('if flashVersion < 5 and IsObject(obFlash) then \n');
		document.write('flashVersion = 4 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.3") end if \n');
		document.write('if flashVersion < 4 and IsObject(obFlash) then \n');
		document.write('flashVersion = 3 \n');
		document.write('end if');
		document.write('</scr' + 'ipt\> \n');
  }
		
	// WebTV 2.5 supports flash 3
	else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

	// older WebTV supports flash 2
	else if (agent.indexOf("webtv") != -1) flashVersion = 2;

	// Can't detect in all other cases
	else {
		flashVersion = flashVersion_DONTKNOW;
	}

	return flashVersion;
}

flashVersion_DONTKNOW = -1;

function interrupt_pop(URL) {
 window.open(URL,"int","scrollbars=0,toolbar=0,location=0,directories=0,status=0,menubar=0,width=400,height=200,screenX=200,screenY=240,left=200,top=220");
}

function confirms_lang(URL) {
 if (confirm(englishRedirect)) {
  window.open(URL);
 }
}

var englishRedirect = "Vous êtes maintenant sur le point de quitter le site Web de P&G Canada. Vous serez dirigé vers le site Web mondial de P&G présenté en anglais seulement.";
/************** script main js ends here*****************/

/************** EDS_TBS js starts here*****************/
function changeTBSImageOnMouseOver(id, cdn) {
		
		 imageName=(id.substring(0,id.indexOf("##")));
		
		if(document.getElementById(id+"toolTips")){
			document.getElementById(id+"toolTips").style.display="block";
		}
		
		var imagePath = cdn + "/pgeds/en_US/data_root/images/newproduct/tbs_buttons/"+ imageName + "_over.gif";
		(document.getElementById(id)).getElementsByTagName("img")[0].src = imagePath;
		

}
function changeTBSImageOnMouseOut(id, cdn) {
		imageName=(id.substring(0,id.indexOf("##")));
		
		
		if(document.getElementById(id+"toolTips")){
			document.getElementById(id+"toolTips").style.display="none";
		}
		var imagePath = cdn + "/pgeds/en_US/data_root/images/newproduct/tbs_buttons/"+imageName + ".gif";
		(document.getElementById(id)).getElementsByTagName("img")[0].src = imagePath;

}

/************** EDS_TBS js ends here*****************/

/**************EDS_Page_Bottom js starts here*****************/	
//	var paramSeg = '<dsp:valueof param="edstempseg" />';
var paramSeg='remove';
	
	if(paramSeg != null && paramSeg != '')
	{
		Set_Cookie( 'CookieSegment', paramSeg, 'Thu,31-Dec-2020 00:00:00 GMT;', '/', '', '' );
		
	}
	
/**************EDS_Page_Bottom js ends here*****************/		


	/****start anil code****/	
	
  
		
		function showFiveInvalidAttemptPopup() {
			$(document).ready(function(){
				//alert("five time error");
				var t = "";
				var a = "#TB_inline?height=280&width=500&inlineId=FifthAttempt&modal=true";
				var g = "";
				tb_show(t,a,g);
			});
			}
		
	
		function showAfterHrsPopup() {
			$(document).ready(function(){				
				var t = "";
				var a = "#TB_inline?height=280&width=500&inlineId=returnAfterHrsPoup&modal=true";
				var g = "";
				tb_show(t,a,g);
			});
			}

		function showBeforeHrsPopup() {
			$(document).ready(function(){
				//alert("Before hrs");
				var t = "";
				var a = "#TB_inline?height=280&width=500&inlineId=returnBeforeHrsPoup&modal=true";
				var g = "";
				tb_show(t,a,g);
			});
			}
		
		function showThreeInvalidAttemptPopup() {
			$(document).ready(function(){
				//alert("Before hrs");
				var t = "";
				var a = "#TB_inline?height=280&width=500&inlineId=threeTimesInvalid&modal=true";
				var g = "";
				tb_show(t,a,g);
			});
			}
		
	
	
	
/*	$(document).ready(function(){
		alert("before 24 hour user comes")
		if($('input.#returnBeforeHrs').val() == "Y") {
			
		$("#loginerror3").bPopup();
		}
		return false
	});
	*/
			
/****end anil code****/	
/**************EDS_Page_Bottom js ends here*****************/		
	
