﻿var vhidApplicationPath;


// Changes the cursor to hand
//***************************

function OnMouseOver_InternalLinks( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "InternalMiddleMenu_MouseOver";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOut_InternalLinks( vControl )
{
	try
	{
		vControl.className = "Tbl_TextTitle1";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

//=-=-=-=-=-=-=-=-=-=-=

function OnMouseOver_InternalLinksHMenu( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "Tbl_TextTitleHLightBlueOverMenu";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOut_InternalLinksMenu( vControl )
{
	try
	{
		vControl.className = "Tbl_TextTitleHLightBlueMenu";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

//=-=-=-=-=-=-=-=-=-=-=

function OnMouseOver_InternalLinksH( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "Tbl_TextTitleHLightBlueOver";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOut_InternalLinksH( vControl )
{
	try
	{
		vControl.className = "Tbl_TextTitleHLightBlue";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOver_InternalLinksIndex( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "InternalMiddleMenu_MouseOver";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOut_InternalLinksIndex( vControl )
{
	try
	{
		vControl.className = "Tbl_TextTitleIndex";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOver( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "MnuText_Over";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOut( vControl )
{
	try
	{
		vControl.className = "MnuText_Out";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}


function OnMouseOverHome( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "MnuText_OverHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}


function OnMouseOutHome( vControl )
{
	try
	{
		vControl.className = "MnuText_OutHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOverHomeSide( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "SideMnuText_OverHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}


function OnMouseOutHomeSide( vControl )
{
	try
	{
		vControl.className = "SideText_OutHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOverHomePoll( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "PollLink_Over";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}


function OnMouseOutHomePoll( vControl )
{
	try
	{
		vControl.className = "PollLink_Out";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOverHomeTop( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "TopMnuText_OverHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}


function OnMouseOutHomeTop( vControl )
{
	try
	{
		vControl.className = "TopText_OutHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOverUCTop( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "TopUCText_OverHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}


function OnMouseOutUCTop( vControl )
{
	try
	{
		vControl.className = "TopUC_OutHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOverNokia( vControl )
{
	try
	{
		vControl.childNodes[ 0 ].childNodes[ 0 ].className = 'Nokia_OverHome';
		vControl.childNodes[ 0 ].childNodes[ 1 ].className = 'Nokia_OverHome';
		vControl.style.cursor = 'hand';
		//vControl.className = "Nokia_OverHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}


function OnMouseOutNokia( vControl )
{
	try
	{
		vControl.childNodes[ 0 ].childNodes[ 0 ].className = 'Nokia_OutHome';
		vControl.childNodes[ 0 ].childNodes[ 1 ].className = 'Nokia_OutHome';
		//vControl.className = "Nokia_OutHome";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

// Get the application path
//***************************
function GetApplicationPath()
{
	try
	{
		vhidApplicationPath = document.getElementById( "__hhidApplicationPath" );
	}
	catch( ex )
	{}
}


// Open page in same window
//***************************

function OpenPageInSameWindow( vTargetPage )
{
	// Get the Applcation Path Hidden Field
	//GetApplicationPath();
	
	// Open the Page
	//window.location = vhidApplicationPath.value + vTargetPage;
	
		// Get the Applcation Path Hidden Field
	GetApplicationPath();
	
	// Open the Page
	window.location = vhidApplicationPath.value + vTargetPage;
	
}






// Swap image and cursor
//***************************
function SwapImageAndCursor( vControl, imgImagetoReplace , blnOver )
{
	// Get the Applcation Paht Hidden Field
	GetApplicationPath();
	
	if( ! vhidApplicationPath )
	{
		//alert( "Does not inherit BaseClass" );
		return;
	}

	// Change the Mouse Cursor`
	/*if ( blnOver )
	
		vControl.style.cursor = 'hand';
	
	else
		vControl.style.cursor = 'default';
	*/
	// Set the New Image
	vControl.src = vhidApplicationPath.value + "/" + imgImagetoReplace;
}


//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

function SwapImageAndCursorForProductUserPage( vControl, imgImagetoReplace , blnOver , vControlTD )
{
	// Get the Applcation Paht Hidden Field
	GetApplicationPath();
	var TDToChange = document.getElementById(vControlTD);
	
	if( ! vhidApplicationPath )
	{
		//alert( "Does not inherit BaseClass" );
		return;
	}

	// Change the Mouse Cursor`
	if ( blnOver )
	{
		TDToChange.parentElement.className = "TblProductsPageOver";
		//alert(vControlTD);
	}
	else
	
		TDToChange.parentElement.className = "TblProductsPageOut";
	
	// Set the New Image
	vControl.src = vhidApplicationPath.value + "/" + imgImagetoReplace;
}

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

function SwapImageAndCursorForProductUserPageCAT( vControl, imgImagetoReplace , blnOver , vControlTD , vControl2 , vControl3 , imgImagetoReplace2  )
{
//alert(vControl);
//alert(imgImagetoReplace);
//alert(blnOver);
//alert(vControlTD);
//alert(vControl2);
//alert(imgImagetoReplace2);
//alert('ok');
	// Get the Applcation Paht Hidden Field
	GetApplicationPath();
	var TDToChange = document.getElementById(vControlTD);
	
	if( ! vhidApplicationPath )
	{
		//alert( "Does not inherit BaseClass" );
		return;
	}

	// Change the Mouse Cursor`
	if ( blnOver )
	{
		TDToChange.parentElement.className = "TblProductsPageOver";
		//alert(vControlTD);
	}
	else
	
		TDToChange.parentElement.className = "TblProductsPageOut";
	
	// Set the New Image
	//alert(imgImagetoReplace);
	//alert(imgImagetoReplace2);
	
	vControl.src = vhidApplicationPath.value + "/" + imgImagetoReplace;
	vControl2.src = vhidApplicationPath.value + "/" + imgImagetoReplace2;
	vControl3.src = vhidApplicationPath.value + "/" + imgImagetoReplace2;
}

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

function SwapImageAndCursorForProductUserPage2( vControl, imgImagetoReplace , blnOver , vControlTD , vControlTDDesc , DescText )
{
	// Get the Applcation Paht Hidden Field
	GetApplicationPath();
	var TDToChange = document.getElementById(vControlTD);
	var TDToChangeDesc = document.getElementById(vControlTDDesc);
	
	if( ! vhidApplicationPath )
	{
		//alert( "Does not inherit BaseClass" );
		return;
	}

	// Change the Mouse Cursor`
	if ( blnOver )
	{
		//alert(vControlTDDesc);
		TDToChange.parentElement.className = "TblProductsPageOver";
		TDToChangeDesc.innerText = DescText;
		//alert(vControlTD);
	}
	else
	{
		TDToChange.parentElement.className = "TblProductsPageOut";
	    DescText="123456789";
		TDToChangeDesc.innerText = DescText;
	}	
		//TDToChangeDesc.innerText = "Hello World";
	
	// Set the New Image
	vControl.src = vhidApplicationPath.value + "/" + imgImagetoReplace;
}

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



function TrimText(str)
{
	return( (""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );
}

function ConfirmDeletion( strItemName )
{
	try
	{
		if( confirm( 'Are you sure you want to delete: "' + strItemName + '"?' ) )
		{
			return true;
		}
		else
			return false;
	}
	catch( ex )
	{
	}
}

function ConfirmItemDeletion( strItemName , strItemCount )
{
	try
	{
		if( confirm( 'Are you sure you want to delete: "' + strItemName + '"?' ) )
		{
			if( parseInt( strItemCount ) > 0 ) 
			{
				alert( 'You cannot delete: "' + strItemName + '" because it is used' );
				return false;
			}
			else
				return true;
		}
	}
	catch( ex )
	{
	}
}

// HabeebS 23.01.2006
// *-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*
function OnMouseOverImg( vControl )
{
	try
	{
		vControl.parentElement.style.cursor = 'hand';
		vControl.parentElement.className = "BorderOn";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOutImg( vControl )
{
	try
	{
		vControl.parentElement.style.cursor = 'default';
		vControl.parentElement.className = "BorderOut";
	}
	catch( ex )
	{
		alert( 'OnMouseOutImg : ' + ex.message )
	}
}
// *-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*-+-*

//Scroll
//*************************************
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()

var speed = 30

var loop, timer

function makeObj(obj,nest){
    nest=(!nest) ? "":'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
	this.up=goUp;this.down=goDown;
	this.moveIt=moveIt; this.x=0; this.y=0;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}

var px = bw.ns4||window.opera?"":"px";

function moveIt(x,y){
	this.x = x
	this.y = y
	this.css.left = this.x+px
	this.css.top = this.y+px
}

function goDown(move){
	if (this.y>-this.scrollHeight+oCont.clipHeight){
		this.moveIt(0,this.y-move)
			if (loop) setTimeout(this.obj+".down("+move+")",speed)
	}
}
//Makes the object go down
function goUp(move){
	if (this.y<0){
		this.moveIt(0,this.y-move)
		if (loop) setTimeout(this.obj+".up("+move+")",speed)
	}
}

//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(speed){
	if (scrolltextLoaded){
		loop = true;
		if (speed>0) oScroll.down(speed)
		else oScroll.up(speed)
	}
}

//Stops the scrolling (called on mouseout)
function noScroll(){
	loop = false
	if (timer) clearTimeout(timer)
}
//Makes the object
var scrolltextLoaded = false
function scrolltextInit(strT){
	oCont = new makeObj('divScrollTextCont' + strT)
	oScroll = new makeObj('divText' + strT,'divScrollTextCont' + strT)
	oScroll.moveIt(0,0)
	oCont.css.visibility = "visible"
	scrolltextLoaded = true
}

// New Horizontal
//*********************************************************
	/*latest 7 */
	function lib_bwcheck7()
	{ //Browsercheck ( needed )
		this.ver=navigator.appVersion
		this.agent=navigator.userAgent
		this.dom=document.getElementById?1:0
		this.opera5=this.agent.indexOf( "Opera 5" )>-1
		this.ie5=( this.ver.indexOf( "MSIE 5" )>-1 && this.dom && !this.opera5 )?1:0; 
		this.ie6=( this.ver.indexOf( "MSIE 6" )>-1 && this.dom && !this.opera5 )?1:0;
		this.ie4=( document.all && !this.dom && !this.opera5 )?1:0;
		this.ie=this.ie4||this.ie5||this.ie6
		this.mac=this.agent.indexOf( "Mac" )>-1
		this.ns6=( this.dom && parseInt( this.ver ) >= 5 ) ?1:0; 
		this.ns4=( document.layers && !this.dom )?1:0;
		this.bw=( this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 )
		return this
	}
	var bw=new lib_bwcheck7()
	var speed7 = 30
	var loop7, timer7
	
	function makeObj7( obj , nest )
	{
		nest=( !nest ) ? "":'document.'+nest+'.'
		this.el=bw.dom?document.getElementById( obj ):bw.ie4?document.all[obj]:bw.ns4?eval( nest+'document.'+obj ):0;
		this.css=bw.dom?document.getElementById( obj ).style:bw.ie4?document.all[obj].style:bw.ns4?eval( nest+'document.'+obj ):0;
		this.scrollWidth=bw.ns4?this.css.document.width:this.el.offsetHeight
		this.clipHeight=bw.ns4?this.css.clip.width:this.el.offsetHeight
		this.up=goUp7;
		this.down=goDown7;
		this.moveIt7=moveIt7;
		this.x=0;
		this.y=0;
		this.obj = obj + "Object"
		eval( this.obj + "=this" )
		return this
	}
	
	var px = bw.ns4||window.opera?"":"px";
	
	function moveIt7( x,y )
	{
		this.x = x
		this.y = y
		this.css.left = this.x+px
		this.css.top = this.y+px
	}
	
	var varPicDivWidth 
	
	function goDown7( move )
	{
		varPicDivWidth = document.getElementById( "hhidPageMode" )
		if ( this.x > (-1 * parseInt(varPicDivWidth.value)) )
		{
			this.moveIt7( this.x-move,0 )
			if ( loop7 )
				setTimeout( this.obj+".down( "+move+" )",speed7 )
		}
	}
	
	//Makes the object go down
	function goUp7( move )
	{
		if ( this.x<0 )
		{
			this.moveIt7( this.x-move,0 )
			if ( loop7 )
				setTimeout( this.obj+".up( "+move+" )",speed7 )
		}
	}
	
	//Calls the scrolling functions. Also checks whether the page is loaded or not.
	function scroll7( speed7 )
	{
		if ( scrolltextLoaded7 )
		{
			loop7 = true;
			if ( speed7 > 0 )
				oScroll7.down( speed7 );
			else
				oScroll7.up( speed7 );
		}
	}
	
	//Stops the scrolling ( called on mouseout )
	function noScroll7()
	{
		loop7 = false
		if ( timer7 )
			clearTimeout( timer7 );
	}
	
	//Makes the object
	var scrolltextLoaded7 = false
	
	function scrolltextInit7()
	{
		try
		{
			oCont7 = new makeObj7( 'divScrollTextCont7' );
			oScroll7 = new makeObj7( 'divText7','divScrollTextCont7' );
			oScroll7.moveIt7( 0 , 0 );
			oCont7.css.visibility = "visible";
			scrolltextLoaded7 = true;
		}
		catch( ex )
		{
			alert( ex.message );
		}
	}
	
	
		/*latest 8 */
	function lib_bwcheck8()
	{ //Browsercheck ( needed )
		this.ver=navigator.appVersion
		this.agent=navigator.userAgent
		this.dom=document.getElementById?1:0
		this.opera5=this.agent.indexOf( "Opera 5" )>-1
		this.ie5=( this.ver.indexOf( "MSIE 5" )>-1 && this.dom && !this.opera5 )?1:0; 
		this.ie6=( this.ver.indexOf( "MSIE 6" )>-1 && this.dom && !this.opera5 )?1:0;
		this.ie4=( document.all && !this.dom && !this.opera5 )?1:0;
		this.ie=this.ie4||this.ie5||this.ie6
		this.mac=this.agent.indexOf( "Mac" )>-1
		this.ns6=( this.dom && parseInt( this.ver ) >= 5 ) ?1:0; 
		this.ns4=( document.layers && !this.dom )?1:0;
		this.bw=( this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 )
		return this
	}
	var bw=new lib_bwcheck8()
	var speed8 = 30
	var loop8, timer8
	
	function makeObj8( obj,nest )
	{
		nest=( !nest ) ? "":'document.'+nest+'.'
		this.el=bw.dom?document.getElementById( obj ):bw.ie4?document.all[obj]:bw.ns4?eval( nest+'document.'+obj ):0;
		this.css=bw.dom?document.getElementById( obj ).style:bw.ie4?document.all[obj].style:bw.ns4?eval( nest+'document.'+obj ):0;
		this.scrollWidth=bw.ns4?this.css.document.width:this.el.offsetHeight
		this.clipHeight=bw.ns4?this.css.clip.width:this.el.offsetHeight
		this.up=goUp8;this.down=goDown8;
		this.moveIt7=moveIt7; this.x=0; this.y=0;
		this.obj = obj + "Object"
		eval( this.obj + "=this" )
		return this
	}
	
	var px = bw.ns4||window.opera?"":"px";
	
	function moveIt7( x,y )
	{
		this.x = x
		this.y = y
		this.css.left = this.x+px
		this.css.top = this.y+px
	}

	
	function goDown8( move )
	{
		if ( this.x>-2600 )
		{
			this.moveIt7( this.x-move,0 )
			if ( loop8 )
				setTimeout( this.obj+".down( "+move+" )",speed8 )
		}
	}
	//Makes the object go down
	function goUp8( move )
	{
		if ( this.x<0 )
		{
			this.moveIt7( this.x-move,0 )
			if ( loop8 )
				setTimeout( this.obj+".up( "+move+" )",speed8 )
		}
	}
	
	//Calls the scrolling functions. Also checks whether the page is loaded or not.
	function scroll8( speed8 )
	{
		if ( scrolltextLoaded8 ){
			loop8 = true;
			if ( speed8>0 )
				oScroll8.down( speed8 )
			else
				oScroll8.up( speed8 )
		}
	}
	
	//Stops the scrolling ( called on mouseout )
	function noScroll8()
	{
		loop8 = false
		if ( timer8 )
			clearTimeout( timer8 )
	}
	//Makes the object
	var scrolltextLoaded8 = false
	function scrolltextInit8()
	{
		oCont8 = new makeObj8( 'divScrollTextCont8' )
		oScroll8 = new makeObj8( 'divText8','divScrollTextCont8' )
		oScroll8.moveIt7( 0,0 )
		oCont8.css.visibility = "visible"
		scrolltextLoaded8 = true
	}



var vhidApplicationPath;


// BishrH 07.03.2007 Check empty Telephone Or E-mail text boxes
//***************************
function CheckTextBoxes_feedBack()
{
	try
	{
		var strTextTel;
		strTextTel = document.getElementById( "wtxtFeedbackTel" );
		
        var strTextEmail;
        strTextEmail = document.getElementById( "wtxtFeedbackEmail" );
        
        
		  if ( strTextTel.value == "" && strTextEmail.value == "" )	
		  {
			alert( "Please enter either a Telephone number or an E-mail address" );
			return false;
		  }
		
		return true;
	}
	catch( ex )
	{
		alert( ex.message );
	}
}

function ReplaceHtmlTags( varFieldName , strText )
{
	try
	{
		var vOpenTag, vCloseTag;
		vOpenTag = document.getElementById( varFieldName + "_hhidHTMLOpen" ).value;
		vCloseTag = document.getElementById( varFieldName + "_hhidHTMLClose" ).value;
		while( strText.indexOf( vOpenTag ) != -1 )
			strText = strText.replace( vOpenTag , '<' );
		while( strText.indexOf( vCloseTag ) != -1 )
			strText = strText.replace( vCloseTag , '>' );
		return strText;
	}
	catch( ex )
	{
		alert( ex.message );
	}
}





// Changes the cursor to hand
//***************************
function OnMouseOver_H( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "MnuText_Over";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOut_H( vControl )
{
	try
	{
		vControl.className = "MnuText_Out";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}


function ReplaceHtmlTags( varFieldName , strText )
{
	try
	{
		var vOpenTag, vCloseTag;
		vOpenTag = document.getElementById( varFieldName + "_hhidHTMLOpen" ).value;
		vCloseTag = document.getElementById( varFieldName + "_hhidHTMLClose" ).value;
		while( strText.indexOf( vOpenTag ) != -1 )
			strText = strText.replace( vOpenTag , '<' );
		while( strText.indexOf( vCloseTag ) != -1 )
			strText = strText.replace( vCloseTag , '>' );
		return strText;
	}
	catch( ex )
	{
		alert( ex.message );
	}
}

function OnMouseOverApp( vControl )
{
	try
	{
		vControl.style.cursor = 'hand';
		vControl.className = "ApplyLink_Over";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}


function OnMouseOutApp( vControl )
{
	try
	{
		vControl.className = "ApplyLink_Out";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

var vVacID

function OpenAppInSameWindow( vTargetPage )
{
	try
	{
		vVacID = document.getElementById( "hhidVacID" ).value;
		
		// Get the Applcation Path Hidden Field
		GetApplicationPath();
	
		// Open the Page
		window.location = vhidApplicationPath.value + vTargetPage + "?VacID=" + vVacID;
	
	}
	catch( ex )
	{}
}

var vControlImg
var vControlTbl
function SwapImageAndCursorBrochure( imgImagetoReplace , blnOver )
{

	vControlImg = document.getElementById( "imgBrochure" );
	vControlTbl = document.getElementById( "tblBrochure" );

	// Get the Applcation Paht Hidden Field
	GetApplicationPath();
	
	if( ! vhidApplicationPath )
	{
		//alert( "Does not inherit BaseClass" );
		return;
	}

	// Change the Mouse Cursor
	if ( blnOver )
	
		vControlTbl.style.cursor = 'hand';
	else
		vControlTbl.style.cursor = 'default';
	
	// Set the New Image
	vControlImg.src = vhidApplicationPath.value + "/" + imgImagetoReplace;
}

function CheckFileExists1()
			{
				try
				{
					debugger;
					var vFileToUpload;
					var filestr;
					
					vFileToUpload = document.getElementById( "fileFileToUpload" );
					
					filestr = vFileToUpload.value ;
					
					alert( filestr);
					
					//var fso = new ActiveXObject('Scripting.FileSystemObject');
					//var fs=fso.getFile(filestr);
					return true;
				}
				catch(Ex)
				{
					alert(Ex.message);
					alert("File does not exist");
					return false;
				} 
			}
			
			
function CheckTextArea( varFieldName, varMsgText )
{
	try
	{
		var strTextArea;
		strTextArea = document.getElementById( varFieldName + "_hhidHtmlText" ).value;
		strTextArea = ReplaceHtmlTags( varFieldName , strTextArea );
		//alert( strTextArea );
		if ( strTextArea == "" || strTextArea == "<P>&nbsp;</P>" )		
		{
			alert( "Please enter " + varMsgText);
			return false;
		}
		return true;
	}
	catch( ex )
	{
		alert( ex.message );
	}
}

function OnMouseOver_Categories( vControl )
{

	try
	{
		var varControl ;
		varControl = document.getElementById( vControl );
		varControl.style.textDecorationUnderline = true;
		varControl.style.cursor = 'hand';
		//vControl.className = "MnuText_Over";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OnMouseOut_Categories( vControl )
{
	try
	{
		var varControl ;
		varControl = document.getElementById( vControl );
		varControl.style.textDecorationUnderline = false;
		//vControl.style.cursor = 'default';
		//varControl.className = "MnuText_Out";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function OpenPageInSameProductsWindow( vTargetPage )
{
	
	GetApplicationPath();
	
//	alert(vTargetPage);
	

	window.location = vhidApplicationPath.value + '/' + vTargetPage;
}



//**************************************************************************************

function ImgResize1()
			{
				try
				{
					var vControl_ProjectImg1;
					var v_Height1;
					var v_Width1;
					var v_HeightFactor1;
					var v_WidthFactor1;
		
					vControl_ProjectImg1 = document.getElementById('imgProduct1');
				
					v_Height1 = vControl_ProjectImg1.height;
					v_Width1 = vControl_ProjectImg1.width;
					v_HeightFactor1 = 120 / v_Height1;

					if (v_Height1 >120)
					{
						vControl_ProjectImg1.height = v_Height1 * v_HeightFactor1;
						vControl_ProjectImg1.width  = v_Width1 * v_HeightFactor1;
					}		
			
					v_Height1 = vControl_ProjectImg1.height;
					v_Width1 = vControl_ProjectImg1.width;
					v_WidthFactor1 = 174 / v_Width1;

					if (v_Width1 > 174)
					{
						vControl_ProjectImg1.height = v_Height1 * v_WidthFactor1;
						vControl_ProjectImg1.width = v_Width1 * v_WidthFactor1;
					}	
				}
				catch( ex )
				{
					alert( 'ImgResize1 : ' + ex.message )
				}			
			}
			
//**************************************************************************************

/*

// added by Sana 9-7-2008 ( select the stylesheet according to the selected language )
function SetStyleSheet()
{   
    var langType = Request.QueryString("language");
    alert("lang ="+ " " + langType);

    if (langType == "en-US")
    {
    document.styleSheets[0].disabled = true;
    document.styleSheets[1].disabled = false;
    }
    else
    {
    document.styleSheets[0].disabled = false;
    document.styleSheets[1].disabled = true;
    }
}
*/
/* No Need for this

function querySt(ji) 
{
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i=0;i<gy.length;i++) {
ft = gy[i].split("=");
if (ft[0] == ji) {
return ft[1];
}
}

}

var koko = querySt("koko");
//document.write(koko);
document.write("<br>");
//alert(hu);
document.write(hu);
*/


//function getQueryVariable(variable) 
//{  var query = window.location.search.substring(1); 
// var vars = query.split("&");  for (var i=0;i<vars.length;i++)
//  {    var pair = vars[i].split("=");  
//    if (pair[0] == variable)
//     {     
//     return pair[1];  
//     document.write(vars); 
//     }  
//  } 
//}

