﻿var vhidApplicationPath;

var vDATECONTROL; 
function check_date()
{
vDATECONTROL = document.getElementById( "ctl00_ContentPlaceHolder1_wtxtCalender" );
//alert('hi');
var checkstr = "0123456789";
var DateField = vDATECONTROL;
var Datevalue = "";
var DateTemp = "";
var seperator = "/";
var day;
var month;
var year;
var leap = 0;
var err = 0;
var i;
   err = 0;
   DateValue = DateField.value;
   /* Delete all chars except 0..9 */
   for (i = 0; i < DateValue.length; i++) {
	  if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
	     DateTemp = DateTemp + DateValue.substr(i,1);
	     //alert('hi');
	  }
   }
   DateValue = DateTemp;
   /* Always change date to 8 digits - string*/
   /* if year is entered as 2-digit / always assume 20xx */
   if (DateValue.length == 6) {
      DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2); }
   if (DateValue.length != 8) {
      err = 19;}
   /* year is wrong if year = 0000 */
   year = DateValue.substr(4,4);
   if (year == 0) {
      err = 20;
   }
   /* Validation of month*/
   month = DateValue.substr(2,2);
   if ((month < 1) || (month > 12)) {
      err = 21;
   }
   /* Validation of day*/
   day = DateValue.substr(0,2);
   if (day < 1) {
     err = 22;
   }
   /* Validation leap-year / february / day */
   if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
      leap = 1;
   }
   if ((month == 2) && (leap == 1) && (day > 29)) {
      err = 23;
   }
   if ((month == 2) && (leap != 1) && (day > 28)) {
      err = 24;
   }
   /* Validation of other months */
   if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
      err = 25;
   }
   if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
      err = 26;
   }
   /* if 00 ist entered, no error, deleting the entry */
   if ((day == 0) && (month == 0) && (year == 00)) {
      err = 0; day = ""; month = ""; year = ""; seperator = "";
   }
   /* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
   if (err == 0) {
      DateField.value = day + seperator + month + seperator + year;
   }
   /* Error-message if err != 0 */
   else {
      alert("Date is incorrect!");
      DateField.select();
	  DateField.focus();
   }
}


function changeTabBg(tabID)
    {
    var tabID = tabID;
    
//    var langType = Request.QueryString("L");
//    alert(langType);
    
    document.getElementById('tabImg').style.backgroundImage="url(images/"+tabID+".gif)";
    
    if (tabID == 'tab1')
    {
    document.getElementById('tab1LinkTD').className = "horizgri";
    document.getElementById('tab2LinkTD').className = "horizred";
    document.getElementById('tab3LinkTD').className = "horizgri";
    }
    if (tabID == 'tab2')
    {
    document.getElementById('tab1LinkTD').className = "horizgri";
    document.getElementById('tab2LinkTD').className = "horizgri";
    document.getElementById('tab3LinkTD').className = "horizred";
    }
    if (tabID == 'tab3')
    {
    document.getElementById('tab1LinkTD').className = "horizred";
    document.getElementById('tab2LinkTD').className = "horizgri";
    document.getElementById('tab3LinkTD').className = "horizgri";
    }
    }
function changeTabBg_Ar(tabID)
    {
    var tabID = tabID;
    
    document.getElementById('tabImg').style.backgroundImage="url(images/"+tabID+"Ar.gif)";
    
    if (tabID == 'tab1')
    {
    document.getElementById('tab3LinkTD').className = "horizgri";
    document.getElementById('tab2LinkTD').className = "horizgri";
    document.getElementById('tab1LinkTD').className = "horizred";
    }
    if (tabID == 'tab2')
    {
    document.getElementById('tab3LinkTD').className = "horizred";
    document.getElementById('tab2LinkTD').className = "horizgri";
    document.getElementById('tab1LinkTD').className = "horizgri";
    }
    if (tabID == 'tab3')
    {
    document.getElementById('tab3LinkTD').className = "horizgri";
    document.getElementById('tab2LinkTD').className = "horizred";
    document.getElementById('tab1LinkTD').className = "horizgri";
    }
    }

// 2 tabs - change
function change2TabBg(tabID)
    {
    var tabID = tabID;
    
//    var langType = Request.QueryString("L");
//    alert(langType);
    
    document.getElementById('tabImg').style.backgroundImage="url(images/"+tabID+".gif)";
    
    if (tabID == '2tab1')
    {
    document.getElementById('tab1LinkTD').className = "horizgri";
    document.getElementById('tab2LinkTD').className = "horizred";
    }
    if (tabID == '2tab2')
    {
    document.getElementById('tab1LinkTD').className = "horizred";
    document.getElementById('tab2LinkTD').className = "horizgri";
    }
    }
function change2TabBg_Ar(tabID)
    {
    var tabID = tabID;
  
    document.getElementById('tabImg').style.backgroundImage="url(images/"+tabID+"Ar.gif)";
    
    if (tabID == '2tab1')
    {
    document.getElementById('tab2LinkTD').className = "horizgri";
    document.getElementById('tab1LinkTD').className = "horizred";
    }
    if (tabID == '2tab2')
    {
    document.getElementById('tab2LinkTD').className = "horizred";
    document.getElementById('tab1LinkTD').className = "horizgri";
    }
    }
// 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 )
				}			
			}
			
function PreventInvalidCharTextArea(e)
{  
    try
        {
            if (e.keyCode == 13)
            {
                return false;
            }
        }
    catch( ex )
		{
			alert( ex.message )
		}		        
}

function TextCounter(field,maxLimit)
{
    try
        {
            if (field.value.length > maxLimit)
            {
           
                field.value = field.value.substring(0,maxLimit);
            }
        }
    catch( ex )
		{
			alert( ex.message )
		}		
}

function RemoveNLandCR(field)
{
    try
        {
           field.value=field.value.replace(/\r\n/g,' ');
        }
    catch( ex )
		{
			alert( ex.message )
		}		
}

function SetImageSrc(varImageCtrlId, varImgPath)
{
    try
        {
           document.getElementById(varImageCtrlId).src=varImgPath;
        }
    catch( ex )
		{
			alert( ex.message )
		}		
}

function ImgAnchMouseOver( vControlImgId, vControlAnchId )
{
	try
	{
		vControlImg = document.getElementById(vControlImgId);
		vControlAnch = document.getElementById(vControlAnchId);
		
		vControlAnch.style.cursor = 'hand';
		vControlAnch.style.color ="#AC0200";
		//vControlAnch.style.fontWeight = "bold";
		
		vControlImg.style.cursor = 'hand';
		vControlImg.border = 1;
		vControlImg.style.borderColor = "#AC0200";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function ImgAnchMouseOut( vControlImgId, vControlAnchId )
{
	try
	{ 
		vControlImg = document.getElementById(vControlImgId);
		vControlAnch = document.getElementById(vControlAnchId);
		
		vControlAnch.style.cursor = 'default';
		vControlAnch.style.color ="#123A80";
		//vControlAnch.style.fontWeight = "normal";
		
		vControlImg.style.cursor = 'default';
		vControlImg.border = 1;
		vControlImg.style.borderColor = "#123A80";
	}
	catch( ex )
	{
		alert( 'OnMouseOut : ' + ex.message )
	}
}

function SetVideoSrc(vPath)
{
    try
        {
           var vVplayer;
           vVplayer = document.getElementById("vidPreview");
           vVplayer.URL = vPath;
           vVplayer.controls.play();
        }
    catch( ex )
		{
			alert( ex.message )
		}		
}

function OpenFileInBrowser(vPath)
{
    try
        {
                window.open(vPath);
        }
    catch( ex )
		    {
			    alert( ex.message )
		    }
}

function OpenImageInBrowser(vImageID)
{
    try
        {
            var ImagePath;
            ImagePath = document.getElementById(vImageID).src;
            if (ImagePath.indexOf('Preview.png') == -1)
            {
                window.open(ImagePath);
            }
        }
    catch( ex )
		    {
			    alert( ex.message )
		    }
}

function AnchMouseOver( vControlAnchId )
{
	try
	{
		vControlAnch = document.getElementById(vControlAnchId);
		vControlAnch.style.cursor = 'hand';
		vControlAnch.style.color ="#AC0200";
		//vControlAnch.style.fontWeight = "bold";
	}
	catch( ex )
	{
		alert( 'OnMouseOver : ' + ex.message )
	}
}

function AnchMouseOut( vControlAnchId )
{
	try
	{ 
		vControlAnch = document.getElementById(vControlAnchId);
		vControlAnch.style.cursor = 'default';
		vControlAnch.style.color ="#123A80";
		//vControlAnch.style.fontWeight = "normal";
	}
	catch( ex )
	{
		alert( 'OnMouseOut : ' + ex.message )
	}
}


function runEXE(ExePath) {
 File=ExePath
 WSH=new ActiveXObject("WScript.shell");
 //Open winMatch in NormalFocusWindow
  WSH.run(File,1,true);
 }
 
 // NevenK 15.05.2011
 function SetVideoSrcForEmbeded(vPath)
{
    try
        {
           var vVplayer;
           vVplayer = document.getElementById("vidPreview");
           vVplayer.src = vPath;
          
        }
    catch( ex )
		{
			alert( ex.message )
		}		
}
		    
