
function clearGeneric(theid, defaultMessage)
{
    //alert(thetext);
    var box = document.getElementById(theid);
    if(box.value == defaultMessage) 
    box.value = ''; 
}

function embedmovie(id, file)
{
    var div = document.getElementById(id);
	var so = new SWFObject("flvplayer.swf","FLVPlayer","255","170","6","#FFFFFF");
	so.addVariable("autostart", "true");	
	so.addVariable("allowfullscreen", "false")
	so.addVariable("file", "ProductVideos/"+file);
	so.addVariable(5);			
	so.write(div);
}

function PrintPartOfTheWebPage()
{  
    //document.Form1.divPrint 
    var prtContent = document.getElementById("printInvoice");
    //var prtContent1 = document.getElementById("divPrint2");

    var WinPrint = 
    window.open('','','letf=50,top=0,width=700,height=600,location=center,toolbar=0,scrollbars=0,status=0'); 
    WinPrint.document.write(prtContent.innerHTML);
    WinPrint.document.close();
    WinPrint.focus();

    WinPrint.print();
    WinPrint.close();
    prtContent.innerHTML = "";

}

function modalPopUp()
{
    document.body.style.overflow = 'hidden';
}
function modalPopUpClose()
{
    document.body.style.overflow = 'auto';
}
//check customer has agreed to non-carried items t&c's
function nonCarriedCheck()
{   
    alert("Checked");
    
    if($('cbAgreeNCTerms')!= null)	
    { 
        if($('cbAgreeNCTerms').checked == 1)
        {
            alert("Checked");
        } 
        else
        {
            alert("Not Checked");
        }
    }
}

// Roll over product Images
function ProductImageRollOver(img_src, imgID)
{
	if($(imgID) != null)	
	{ 
		$(imgID).src = img_src; 
		//document.body.style.cursor='pointer'
	}
}
// Roll out product Images
function ProductImageRollOut(img_src, imgID)
{
    document.body.style.cursor='auto'
    
	if($(imgID) != null)	
	{	
		$(imgID).src = img_src; 
	}
}
function toggleMenu(objID) {
    if (!document.getElementById) return;
    var ob = document.getElementById(objID).style;
    ob.display = (ob.display == 'block')?'none': 'block';
}

function hideMenu() {
   
    if($('electricitymonitors') != null){ $('electricitymonitors').style.display = 'none';  }
    if($('standbysavers') != null) { $('standbysavers').style.display = 'none'; } 
    if($('lighting') != null) { $('lighting').style.display = 'none'; }
    if($('powerfactorreducers') != null) { $('powerfactorreducers').style.display = 'none'; }
    if($('recycling') != null) { $('recycling').style.display = 'none'; }	
    if($('windup') != null) { $('windup').style.display = 'none'; }	 
    if($('kettles') != null) { $('kettles').style.display = 'none'; }
    if($('laundry') != null) { $('laundry').style.display = 'none'; }	
    if($('waterpowered') != null) { $('waterpowered').style.display = 'none'; }	    
    if($('refridgeration') != null) { $('refridgeration').style.display = 'none'; }	    
    if($('windturbines') != null) { $('windturbines').style.display = 'none'; }
    if($('inverters') != null) { $('inverters').style.display = 'none'; }	 
    if($('batteries') != null) { $('batteries').style.display = 'none'; }	  
    if($('weatherstations') != null) { $('weatherstations').style.display = 'none'; } 
    if($('household') != null) { $('household').style.display = 'none'; }  
    if($('regulators') != null) { $('regulators').style.display = 'none'; }
    if($('marinewindturbinekits') != null) { $('marinewindturbinekits').style.display = 'none'; } 
    if($('homewindturbinekits') != null) { $('homewindturbinekits').style.display = 'none'; } 
    if($('boatwindchargerkits') != null) { $('boatwindchargerkits').style.display = 'none'; } 
    if($('solar') != null) { $('solar').style.display = 'none'; } 
    if($('mountingandrigging') != null) { $('mountingandrigging').style.display = 'none'; } 
    if($('cablesandconnectors') != null) { $('cablesandconnectors').style.display = 'none'; } 
    if($('educationalwindturbinekits') != null) { $('educationalwindturbinekits').style.display = 'none'; } 
}

function showInnerSubMenu(inner)
{   
    //alert(inner)
    switch(inner)
    {      
        case "electricitymonitors":
            if($('electricitymonitors') != null){ $('electricitymonitors').style.display = 'block'; }       
            break;
        case "standbysavers":            
	        if($('standbysavers') != null) { $('standbysavers').style.display = 'block'; }		              
            break;
        case "lighting":           
	        if($('lighting') != null) { $('lighting').style.display = 'block'; }	            
            break;
         case "powerfactorreducers":           
	        if($('powerfactorreducers') != null) { $('powerfactorreducers').style.display = 'block'; }	             
            break;
        case "recycling":            
	        if($('recycling') != null) { $('recycling').style.display = 'block'; }		           
            break;
        case "windup":           
	        if($('windup') != null) { $('windup').style.display = 'block'; }	 	        
            break;
        case "kettles":           
	        if($('kettles') != null) { $('kettles').style.display = 'block'; }	               
            break;
         case "laundry":           
	        if($('laundry') != null) { $('laundry').style.display = 'block'; }		             
            break;
        case "waterpowered":           
	        if($('waterpowered') != null) { $('waterpowered').style.display = 'block' }       
            break;
        case "refridgeration":                
	        if($('refridgeration') != null) { $('refridgeration').style.display = 'block'; }	        
            break;
        case "windturbines":                
	        if($('windturbines') != null) { $('windturbines').style.display = 'block'; }	        
            break;
        case "inverters":                
	        if($('inverters') != null) { $('inverters').style.display = 'block'; }	        
            break;
         case "batteries":                
	        if($('batteries') != null) { $('batteries').style.display = 'block'; }	        
            break;    
        case "weatherstations":                
	        if($('weatherstations') != null) { $('weatherstations').style.display = 'block'; }	        
            break;
        case "household":                
	        if($('household') != null) { $('household').style.display = 'block'; }	        
            break;
        case "regulators":                
	        if($('regulators') != null) { $('regulators').style.display = 'block'; }	        
            break;
         case "homewindturbinekits":                
	        if($('homewindturbinekits') != null) { $('homewindturbinekits').style.display = 'block'; }	        
            break;
        case "marinewindturbinekits":                       
	        if($('marinewindturbinekits') != null) { $('marinewindturbinekits').style.display = 'block'; }	        
            break;
        case "solar":                
	        if($('solar') != null) { $('solar').style.display = 'block'; }	        
            break;  
        case "boatwindchargerkits":                
	        if($('boatwindchargerkits') != null) { $('boatwindchargerkits').style.display = 'block'; }
	    case "mountingandrigging":                
	        if($('mountingandrigging') != null) { $('mountingandrigging').style.display = 'block'; }
	        break;
	    case "cablesandconnectors":                
	        if($('cablesandconnectors') != null) { $('cablesandconnectors').style.display = 'block'; }	        
            break;   
         case "educationalwindturbinekits":                
	        if($('educationalwindturbinekits') != null) { $('educationalwindturbinekits').style.display = 'block'; }	        
            break;    
        default:        
            if($('electricitymonitors') != null){ $('electricitymonitors').style.display = 'none'; }
	        if($('standbysavers') != null) { $('standbysavers').style.display = 'none'; }
	        if($('lighting') != null) { $('lighting').style.display = 'none'; }
	        if($('powerfactorreducers') != null) { $('powerfactorreducers').style.display = 'none'; }
	        if($('recycling') != null) { $('recycling').style.display = 'none'; }	
	        if($('windup') != null) { $('windup').style.display = 'none'; }	 
	        if($('kettles') != null) { $('kettles').style.display = 'none'; }
	        if($('laundry') != null) { $('laundry').style.display = 'none'; }	
	        if($('waterpowered') != null) { $('waterpowered').style.display = 'none'; }	    
	        if($('refridgeration') != null) { $('refridgeration').style.display = 'none'; }	
	        if($('windturbines') != null) { $('windturbines').style.display = 'none'; }
            if($('inverters') != null) { $('inverters').style.display = 'none'; }	 
            if($('batteries') != null) { $('batteries').style.display = 'none'; }	  
            if($('weatherstations') != null) { $('weatherstations').style.display = 'none'; } 
            if($('household') != null) { $('household').style.display = 'none'; }  
            if($('regulators') != null) { $('regulators').style.display = 'none'; }    
            if($('marinewindturbinekits') != null) { $('marinewindturbinekits').style.display = 'none'; } 
            if($('homewindturbinekits') != null) { $('homewindturbinekits').style.display = 'none'; } 
            if($('solar') != null) { $('solar').style.display = 'none'; } 
            if($('boatwindchargerkits') != null) { $('boatwindchargerkits').style.display = 'none'; } 
            if($('mountingandrigging') != null) { $('mountingandrigging').style.display = 'none'; } 
            if($('cablesandconnectors') != null) { $('cablesandconnectors').style.display = 'none'; } 
            if($('educationalwindturbinekits') != null) { $('educationalwindturbinekits').style.display = 'none'; } 
            
            break;            
    }    
}

function detailsReviewHover()
{
    document.body.style.cursor = 'pointer';
}
function detailsReviewHoverOut()
{
    document.body.style.cursor = 'text';
}

var activeDetailTab = 'How';

function detailsTabHover(tab)
{   
    document.body.style.cursor = 'pointer';
    switch(tab)    {
        
        case "how":
            if($('how') != null){$('howTab').className = 'detailsTabActive';}	        	         
            break;
            
        case "spec":                        	        
	        if($('spec') != null){ $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTabActive'; }	        	    
            break;
            
        case "faqs":                        	        
	        if($('faqs') != null){ $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTabActive'; }	        	    
            break;
            
        case "rev":            
	        if($('rev') != null) { $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTabActive'; }	   
	        break;
	        
	    case "whatsin":            
	        if($('whatsin') != null) { $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTabActive'; }	   
	        break;		
	                      
        default:
            if($('howTab') != null){ $('howTab').style.display = 'block';  } 
	        if($('ctl00_ContentPlaceHolder1_specTab') != null){ $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; }
	        if($('ctl00_ContentPlaceHolder1_faqsTab') != null){ $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab'; }
	        if($('ctl00_ContentPlaceHolder1_revTab') != null){ $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab';  } 
	        if($('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab';  } 
            break;            
    }
}
function detailsTabOut()
{
    document.body.style.cursor = 'text';       
    
    if(activeDetailTab == 'How')
    {
        if($('ctl00_ContentPlaceHolder1_specTab') != null){ $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_revTab') != null){ $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_faqsTab') != null){ $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab'; }
    }
    else if(activeDetailTab == 'Spec')
    { 
        if ($('howTab') != null){$('howTab').className = 'detailsTab';}
        if($('ctl00_ContentPlaceHolder1_revTab') != null){ $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_faqsTab') != null){ $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab'; }
    }
    else if(activeDetailTab == 'Faqs')
    { 
        if ($('howTab') != null){$('howTab').className = 'detailsTab';}
        if($('ctl00_ContentPlaceHolder1_specTab') != null){ $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_revTab') != null){ $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab'; }
    }
    else if(activeDetailTab == 'Rev')
    {
        if($('howTab') != null){$('howTab').className = 'detailsTab';}
        if($('ctl00_ContentPlaceHolder1_specTab') != null){ $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_faqsTab') != null){ $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab'; }
    }
    else if(activeDetailTab == 'Whatsin')
    {
        if($('howTab') != null){$('howTab').className = 'detailsTab';}
        if($('ctl00_ContentPlaceHolder1_specTab') != null){ $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; }
        if($('ctl00_ContentPlaceHolder1_revTab') != null){ $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab'; }  
        if($('ctl00_ContentPlaceHolder1_faqsTab') != null){ $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab'; }     
    }
}

function detailsTabClick(tab)
{    
    document.body.style.cursor = 'pointer';
    switch(tab)    
    {        
        case "how":
            if($('how') != null)
            { 
                activeDetailTab = 'How';
                $('how').style.display = 'block';
                $('howTab').className = 'detailsTabActive';            
            }	        
            if($('spec') != null){ $('spec').style.display = 'none'; $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; }
            if($('faqs') != null){ $('faqs').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_faqTab') != null ) { $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab'; }}
            if($('rev') != null){ $('rev').style.display = 'none';  if( $('ctl00_ContentPlaceHolder1_revTab') != null ) {$('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab';} } 	         
            if($('whatsin') != null){ $('whatsin').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab'; } }
            break;
            
        case "spec":                        	        
	        if($('spec') != null)
	        { 
	            activeDetailTab = 'Spec';
	            $('spec').style.display = 'block'; 
	            $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTabActive';            
	        }	        	    
	        if($('how') != null){ $('how').style.display = 'none';  $('howTab').className = 'detailsTab'; } 
	        if($('faqs') != null){ $('faqs').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_faqTab') != null ) { $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab'; }}
	        if($('rev') != null){ $('rev').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_revTab') != null ){ $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab';} }  
	        if($('whatsin') != null){ $('whatsin').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab'; } }
            break;
            
        case "faqs":                        	        
	        if($('faqs') != null)
	        { 
	            activeDetailTab = 'Faqs';
	            $('faqs').style.display = 'block'; 
	            $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTabActive';            
	        }	        	    
	        if($('how') != null){ $('how').style.display = 'none';  $('howTab').className = 'detailsTab'; } 
	        if($('spec') != null){ $('spec').style.display = 'none'; $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; }
	        if($('rev') != null){ $('rev').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_revTab') != null ){ $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab';} }  
	        if($('whatsin') != null){ $('whatsin').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab'; } }
            break;
            
        case "rev":            
	        if($('rev') != null) 
	        { 
	            activeDetailTab = 'Rev';
	            $('rev').style.display = 'block' 
	            $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTabActive';     
	            
	        }
	        if($('how') != null){ $('how').style.display = 'none';  $('howTab').className = 'detailsTab'; }
	        if($('faqs') != null){ $('faqs').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_faqTab') != null ) { $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab'; } }
	        if($('spec') != null){ $('spec').style.display = 'none'; $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; } 	   
	        if($('whatsin') != null){ $('whatsin').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab'; } }
	        break;
	        
	   case "whatsin":            
	        if($('whatsin') != null) 
	        { 
	            activeDetailTab = 'Whatsin';
	            $('whatsin').style.display = 'block' 
	            $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTabActive';     
	        }
	        if($('how') != null){ $('how').style.display = 'none';  $('howTab').className = 'detailsTab'; } 
	        if($('faqs') != null){ $('faqs').style.display = 'none';  if( $('ctl00_ContentPlaceHolder1_faqTab') != null ){ $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab';} }
	        if($('spec') != null){ $('spec').style.display = 'none'; $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; } 	   
	        if($('rev') != null){ $('rev').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_revTab') != null ){ $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab';} } 
	        break;	
	        	                      
        default:
            if($('how') != null){ $('how').style.display = 'block'; $('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTabActive';  } 
	        if($('spec') != null){ $('spec').style.display = 'none'; $('ctl00_ContentPlaceHolder1_specTab').className = 'detailsTab'; }
	        if($('faqs') != null){ $('faqs').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_faqTab') != null ) { $('ctl00_ContentPlaceHolder1_faqsTab').className = 'detailsTab'; }}
	        if($('rev') != null){ $('rev').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_revTab') != null ) {$('ctl00_ContentPlaceHolder1_revTab').className = 'detailsTab';} } 
	        if($('whatsin') != null){ $('whatsin').style.display = 'none'; if( $('ctl00_ContentPlaceHolder1_whatsinTab') != null){ $('ctl00_ContentPlaceHolder1_whatsinTab').className = 'detailsTab'; } }
            break;            
    }
}
function $() {
  var elements = new Array();
  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);
    if (arguments.length == 1)
      return element;
    elements.push(element);
  }
  return elements;
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function btnEditPersonal_Click(divElement)
{
    var ob = document.getElementById(divElement);	
    ob.visible.visible = true
}






















































// *******************************************************************************************************
// JavaScript Document
// CSS Pop Ups
// AJH - 25/09/2006
// *******************************************************************************************************
/*
Simple Image Trail script- By JavaScriptKit.com
Edited by awestmoreland: http://www.sitepoint.com/forums/member.php?u=22198
*/
var offsetfrommouse = [15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration = 0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 5;	// maximum image size.

if (document.getElementById || document.all){
	document.write('<div id="CssPopUp">');
	document.write('</div>');
}
function gettrailobj()
{
	if (document.getElementById)
		return document.getElementById("CssPopUp").style
	else if (document.all)
		return document.all.trailimagid.style
}

function gettrailobjnostyle()
{
	if (document.getElementById)
		return document.getElementById("CssPopUp")
	else if (document.all)
		return document.all.trailimagid
}
function truebody()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function showtrail(title,description)
{
	document.onmousemove=followmouse;
	var newHTML = new StringBuilder();
	newHTML.append('<div class="CssRollOver">');
	newHTML.append('<b>' + title + '</b><br /><br />');
	newHTML.append(description + '<br />');
	newHTML.append('</div>');
	gettrailobjnostyle().innerHTML = newHTML.toString();
	gettrailobj().visibility="visible";
}
function showtrail2(title,description)
{
	document.onmousemove=followmouse;
	var newHTML = new StringBuilder();
	newHTML.append('<div class="CssRollOver2">');
	newHTML.append('<b>' + title + '</b><br /><br />');
	newHTML.append(description + '<br />');
	newHTML.append('</div>');
	gettrailobjnostyle().innerHTML = newHTML.toString();
	gettrailobj().visibility="visible";
}
function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	gettrailobj().left="-500px"
}
function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	//if (document.all){
	//	gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
	//} else {
	//	gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
	//}

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < 300){
			xcoord = e.pageX - xcoord - 286; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < (currentimageheight + 110)){
			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){

		if (docwidth - event.clientX < 300){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 286; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (currentimageheight + 110)){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
	if(ycoord < 0) { ycoord = ycoord*-1; }
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}


function SetFocus(e,id)
{
    var characterCode //literal character code will be stored in this variable

    if(e && e.which){ //if which property of event object is supported (NN4)
    e = e
    characterCode = e.which //character code is contained in NN4's which property
    }
    else{
    e = event
    characterCode = e.keyCode //character code is contained in IE's keyCode property
    }

    if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
        $(id).focus();

    }

}
