hotContent// login popup
function loginPg(){
	dC = window.open("login.html","dealerCommunity","resizable=yes,status=no,toolbar=no,menubar=no");
	dC.resizeTo(300,250);
	dC.focus();
}
/*
	changeParent(url)
	changes url of parent window from a popup
	/audio_video/index.html
*/

/* ACTIVEX Start */
function _ShowEmbedObject(_ELEMENT_ID)
{
	document.write( _ELEMENT_ID.text );
	_ELEMENT_ID.id = "";
}
/* ACTIVEX End */


function changeParent(url){
	if(window.opener) window.opener.location = url;
	window.opener.focus();
}
/*
	enlargeImg()
	changes the ad image for the expierence LG section
	/experience_lg/
*/
function changeAd(preNum,num){
	loadImage = preNum+num+"L";
	
	if(preNum=='internet_mobile_')
		flip('ad_big',loadImage, preNum+num, preNum);
	else
		flip('ad_big',loadImage);
}

function setAd(preNum){
	var args = new Object();
	var query = location.search.substring(1);
//	alert(query);
	var pairs = query.split("&");
	for(i=0;i<pairs.length;i++){
		var pos = pairs[i].indexOf('=');
		if (pos == -1) continue;
		var argname = pairs[i].substring(0,pos);
		var value = pairs[i].substring(pos+1);
		args[argname] = unescape(value);
	}
//	return args;
	if(document.images){
		if (args.ad){
			loadImage = preNum+args.ad+"L";
			
			if(preNum=='internet_mobile_')
				flip('ad_big',loadImage, preNum+args.ad, preNum);
			else
				flip('ad_big',loadImage);
			
		}else{
			
			loadImage = preNum+"1"+"L";
			
			if(preNum=='internet_mobile_')
				flip('ad_big',loadImage, preNum+"1", preNum);
			else
				flip('ad_big',loadImage);
			
		}
	}
//flip('ad_big',loadImage);
	
}
function  tvAds(defaultVid){
	var args = new Object();
	var query = location.search.substring(1);
	var pairs = query.split(",");
	for(i=0;i<pairs.length;i++){
		var pos = pairs[i].indexOf('=');
		if (pos == -1) continue;
		var argname = pairs[i].substring(0,pos);
		var value = pairs[i].substring(pos+1);
		args[argname] = unescape(value);
	}

	videoFile=(args.filename)?args.filename:defaultVid;
	videoFile+='.asx';
	
	embedVideo=	'<OBJECT ID="MediaPlayer" WIDTH=320 HEIGHT=309 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"';
	embedVideo+='codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"';
	embedVideo+='standby="Loading Microsoft Windows Media Player components..."';
	embedVideo+='type="application/x-oleobject">';
	embedVideo+='<PARAM NAME="FileName" VALUE="/images/front/tv_ads/';
	embedVideo+=videoFile;
	embedVideo+='">';
	embedVideo+='<PARAM NAME="ShowControls" VALUE="1">';
	embedVideo+='<PARAM NAME="ShowDisplay" VALUE="0">';
	embedVideo+='<PARAM NAME="ShowStatusBar" VALUE="1">';
	embedVideo+='<PARAM NAME="AutoSize" VALUE="0">';
	embedVideo+='<PARAM NAME="autoStart" VALUE="1">';
	embedVideo+='<Embed type="application/x-mplayer2"';
	embedVideo+='pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"';
	embedVideo+='filename="/images/front/tv_ads/';
	embedVideo+=videoFile;
	embedVideo+='" src="/images/front/tv_ads/';
	embedVideo+=videoFile;
	embedVideo+='" Name=MediaPlayer';
	embedVideo+='ShowControls=1';
	embedVideo+='ShowDisplay=0';
	embedVideo+='ShowStatusBar=1';
	embedVideo+='AutoStart=1';
	embedVideo+='width=320';
	embedVideo+='height=309>';
	embedVideo+='</embed></OBJECT>';
	
	document.write(embedVideo);
}
/*
	enlargeImg()
	Changes href of enlarge image as user changes view.
	used in the product section. 
	/products/[all files]
*/
function enlargeImg(url,num){
	
	document.getElementById('enlarge').setAttribute("href",url);
}
/*
	menu_init();
	Initializes the on state of level 4 dynamic layers
	Used in the product section.
	/products/[all files]
*/
function menu_init(){
	if (document.getElementById('myFirst')) 
	{
		//alert("+++++++++++11111111111111111+++++++++++++++=");
		menuOn=document.getElementById('myFirst');
	}
}

/* 
	turnOff()
	Changes image to the off state
	used on all pages

*/
function turnOff(){
	args = arguments.length;
	for(i=0;i<args;i++){
		flip(arguments[i],arguments[i]);
	}
}
/* 
	changeClass()
	Changes the class of the level 4 layer navigation
	Used in 
	/products/[all files]
	/index.html

*/
function changeClass(obj,offState,onState){
	//alert(menuOn.className);
	//alert(obj.className);
	if (menuOn!="") {
		menuOn.className=offState;
	}
 	obj.className = onState;
	menuOn=obj;
}

function changeSize(obj,pwidth,pheight){
	//alert(menuOn.className);
	//alert(document.all[obj].width );
	//alert(document.all[obj].src);
	//document.getElementById(obj).width = pwidth;
	//eval('document.'+obj+'.width') = pwidth;
	//eval('document.'+obj+'.height') = pheight;
	document.all[obj].width = pwidth;
	document.all[obj].height = pheight;
		
 	//obj.width = pwidth;
	//obj.height = pheight;
	//alert(pwidth);
	//alert(pheight);
	
}
/*
	hotContent()
	changes the html text for the hot products section 
	Used on
	/index.html
	/products/index.html
	/products/h_appliances/index.html
	/products/c_products/index.html
	/products/mobile/index.html
	/products/audio_video/index.html
*/
function hotContent(obj1,txt1,obj2,txt2){
	document.getElementById(obj1).innerHTML = txt1;
	document.getElementById(obj2).innerHTML = txt2;
}

function popup(URL,title,features) {
	newWin=	window.open(URL,title,features);
	newWin.focus();
}

/*
	gothere()
	Jumps to the page selected in the global links pulldown.
	used on all pages.	
*/

function gothere() {
    var index=document.myform.dest.selectedIndex;
    if (index !=0) {
    var remote=document.myform.dest.options[index].value.substring(0,1);
    var url=document.myform.dest.options[index].value.substring(1);
	if (remote == "a")
	window.open(url,"newwindow","scrollbars=yes,menubar=yes,status=yes,toolbar=yes,resizable=yes");
	else
	return;
	//this.location=(url);
	} 
}
/*
	createObj()
	show()
	hide()
	Show and hide layers on level 4 layers
	used in the products section
	/products/[all files]
*/
function createObj(obj) {
	if(dom&&!ie5) return document.getElementById(obj).style;
	else if(ie4||ie5) return document.all[obj].style;
	else return eval('document.'+arguments[obj]);
}
function showViews(obj){
	objRef = createObj(obj);
	var showMe = (ns4)?"show":"visible";
	objRef.visibility = showMe;
	if (obj!=currView)hide(currView);
	currView=obj;
}


function show(obj){
	objRef = createObj(obj);
	var showMe = (ns4)?"show":"visible";
	objRef.visibility = showMe;
	if (currOpen!=""&&currOpen!=obj) hide(currOpen);
	currOpen=obj;
}
function hide(obj){
	objRef = createObj(obj);
	var hideMe = (ns4)?"hide":"hidden";
	objRef.visibility = hideMe;
}
/*	
	preLoad()
	preloads image rollovers
	Used on all pages.

*/
function preLoad(){
	var newPath="";
	var newImg="";
	var name="";
	if(document.images) {
		for(var i = 0; i < arguments.length; i++)  {
			if(arguments[i].indexOf("/")>-1){
				newPath = arguments[i].substring(0,arguments[i].lastIndexOf("/"));
				arguments[i] = arguments[i].substring(arguments[i].lastIndexOf("/")+1);
			}
		  	var arg = arguments[i].split(".");
			imgPath = (newPath!="")?iPath+newPath+"/" + arg[0] + '.' + arg[1]:iPath+ arg[0] + '.' + arg[1];
			name = "d"+arg[0];
			//alert(name);
			self[name] = new Image();
			self[name].src = imgPath;
			newPath=""
		}
	}
}

/*	
	flip()
	image rollovers
	Used on all pages.

*/
function flip() {
	if (document.images!= null) {
			var num_arg = arguments.length;
			if (num_arg == 0 || (num_arg % 2) != 0) return;
			for (var i=0; i<num_arg; i) {
					var j = i+1;

					var imgname = arguments[i];
					var imgsrc = arguments[j];
					if(arguments[j+2]=='internet_mobile_'){
						document.getElementById('ad_ref').href="javascript:popup('/experience/internet_ads/"+arguments[j+1]+".html','internet','width=800,height=600,scrollbars=yes')";
						i+=4;
					}else
						i+=2;//document.imagesddd[imgname].src = eval(imgsrc+'.src');
					eval("document.images[imgname].src = d"+imgsrc+".src");
					
			}
	}

}

/*
	getProduct()
	Used for the pulldown select box
	/products/[all files]
*/
function getProduct(obj){
	if (obj[0].value!="") {
		this.location = obj[0].value;
	}
}

/* 	
writeFlash()
	Writes flash piece and non flash image.

	/index.html
	/about_lg/index.html
	/experience_lg/index.html
	/products/c_products/index.html
	/products/mobile/index.html
	/products/h_appliances/index.html

	
*/
function writeFlash(swf,noFlash,bg,w,h,loopVar){
	if ( shockver >= 4 ) {
	    flashcode = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		flashcode += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
		flashcode += ' ID=client WIDTH=';
		flashcode += w;
		flashcode += ' HEIGHT=';
		flashcode += h;
		flashcode += '>';
		flashcode += '  <PARAM NAME=movie VALUE="';
		flashcode += swf;
		flashcode += '"> ';
		flashcode += '  <PARAM NAME=quality VALUE=high> ';
		flashcode += '  <PARAM NAME=bgcolor VALUE=#';
		flashcode += bg;
		flashcode += '> ';
		flashcode += '<EMBED src="';
		flashcode += swf;
		flashcode += '" swLiveConnect=FALSE WIDTH=';
		flashcode += w;
		flashcode += ' HEIGHT=';
		flashcode += h;
		flashcode += ' QUALITY=high BGCOLOR=#';
		flashcode += bg;
		flashcode += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
		flashcode += '</EMBED>';
		flashcode += '</OBJECT>'; 
	}
	else {
		flashcode = '<img src="';
		flashcode += noFlash;
		flashcode += '" alt="" width="';
		flashcode += w;
		flashcode += '" height="';
		flashcode += h;
		flashcode += '" border="0">';
	}
	
	document.write(flashcode);
}

/* FlashDetect  */
var shockver = 0;
var flashcode = "";
var FlashMode3 = 0;
var FlashMode4 = 0;
var FlashMode5 = 0;
var FlashMode6 = 0;


/* navigator -- Required */
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (plugin) {
	if ( parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) == 3 ) shockver = 3;
	if ( parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4 ) shockver = 4;
	if ( parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) == 5 ) shockver = 5;
	if ( parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 6 ) shockver = 6;
}

/* ie -- Required */
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.userAgent.indexOf("Windows")>=0 && navigator.userAgent.indexOf("3.1")<0)) {
	document.write('\<script language=\"VBScript\"\> \n');
    document.write('on error resume next \n');
	document.write('FlashMode3 = 0 \n');
	document.write('FlashMode4 = 0 \n');
	document.write('FlashMode5 = 0 \n');
	document.write('FlashMode6 = 0 \n');
	document.write('FlashMode3 = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")) \n');
	document.write('FlashMode4 = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")) \n');
	document.write('FlashMode5 = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")) \n');
	document.write('FlashMode6 = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")) \n');
    document.write('\<\/SCRIPT\> \n');
	
	if (FlashMode3) shockver = 3;
	if (FlashMode4) shockver = 4;
	if (FlashMode5) shockver = 5;
	if (FlashMode6) shockver = 6;
}


currView ='view1';
viewOn=""
menuOn="";
currOpen="";
ver = navigator.appVersion;
agent = navigator.userAgent;
pc = (navigator.platform.indexOf("Win")<0)?0:1;
mac = (navigator.platform.indexOf("Mac")<0)?0:1;
dom = document.getElementById?1:0;
ie4 = (document.all && !this.dom)?1:0;
ie5 = (this.ver.indexOf("MSIE 5")<0)?0:1;
ie6 = (this.ver.indexOf("MSIE 6")<0)?0:1;
ns4 = (document.layers && !this.dom)?1:0;
ns6 = (dom && agent.indexOf("Netscape")>-1)?1:0;

var iPath2 = '/images/';
var iPath = '/';

var embedVideo =""

var linecode='<div id="line" style="position:absolute;left:190px;top:';
linecode+=(ie5||ie6)?783:785;
linecode+='px;">';
linecode+='<table cellpadding="0" cellspacing="0" border="0">';
linecode+='<tr>';
linecode+='<td bgcolor="#cfcfcf"><img src="/images/1px.gif" width="200" height="1" alt="" border="0"></td>';
linecode+='</tr>';
linecode+='</table>';
linecode+='</div>';

var linecode2='<div id="line" style="position:absolute;left:190px;top:';
linecode2+=(ie5||ie6)?790:792;
linecode2+='px;">';
linecode2+='<table cellpadding="0" cellspacing="0" border="0">';
linecode2+='<tr>';
linecode2+='<td bgcolor="#cfcfcf"><img src="/images/1px.gif" width="200" height="1" alt="" border="0"></td>';
linecode2+='</tr>';
linecode2+='</table>';
linecode2+='</div>';

window.onload = menu_init;
//preLoad('common_nav1.gif','common_nav1_on.gif','common_nav2.gif','common_nav2_on.gif','common_nav3.gif','common_nav3_on.gif','common_nav4.gif','common_nav4_on.gif','products/mag.gif','products/mag_on.gif');

function winOpenGallery(url){
	popup(url,"Gallery","resizable=yes,toolbar=no,location=no,width=325,height=380,directories=no,status=no,scroll=yes,scrollbars=auto,menubar=no,left=0,top=0");
	return;
}
/*
function functionOn() {
	if (event.keyCode == 8) {
		alert(location.pathname);
		if ( (location.pathname.indexOf("/Product") > -1 || location.pathname.indexOf("/AboutUs") > -1)
			&& location.pathname.indexOf(".jhtml") > -1)
		{
			history.go(-2);
		}
	}
}

document.onkeydown = functionOn;
*/
