// JavaScript Document for Dell Customer Experience Center
// Designed by Lee Young Kwon
// Ask more lee.youngkwon@gmail.com

// search option
function searchForm(){
	var m_search = "<form style=\"padding:0px;margin:0px;\" name=\"search\" action=\"http://searchapj.dell.com/results.aspx?s=gen&c=kr&l=ko\" method=\"get\" target=\"_blank\"><input type=\"hidden\" name=\"s\" value=\"gen\" ><input type=\"hidden\" name=\"c\" value=\"kr\" ><input type=\"hidden\" name=\"l\" value=\"ko\" ><input type=\"hidden\" name=\"cs\" value=\"\"><div align=\"right\" ><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" ><tr><td><input id=\"searchinput\" title=\"키워드 검색\" class=\"formBdW\" onfocus=\"if(value=='키워드 검색')value='';\" value=\"키워드 검색\" name=\"k\" type=\"text\" size=\"20\"></td><td>&nbsp;<select class=\"formBdW\" id=\"cat\" name=\"cat\" title=\"Search In\"  onchange=\"SetSeachComboTitle(this)\"><option value=\"all\" selected=\"true\">모든 결과</option><option value=\"prod\" >제품</option><option value=\"sup\" >기술 지원</option><option value=\"ans\" >관련 내용 & 솔루션</option><option value=\"abt\" >Dell 관련</option></select>&nbsp;</td><td><a href=\"javascript:document.forms['search'].submit();\"><input onclick=\"if(document.forms['search'].searchinput.value=='키워드 검색')document.forms['search'].searchinput.value='';\" class=\"searchaction\" type=\"image\" border=\"0\" src=\"/images/bt_search.gif\" alt=\"Search\" width=\"24\" height=\"19\" hspace=\"2\" vspace=\"0\"></a></td></tr></table></div></form>";
	if ( typeof( m_supressSearch ) == "undefined" || m_supressSearch == false ) {
	document.write( "<div class=\"searchcontainer\" id=\"searchcontainer\"></div>")
		if( m_search ) {
			document.write( m_search );
		} else {
			renderSearchLinks();
		}
	}
}
// set the title of the search combo
function SetSeachComboTitle (SelectObj) {
if (SelectObj) {
	if (SelectObj.selectedIndex > -1)	{
		if (SelectObj.options[SelectObj.selectedIndex].value != ""){ 
			var searchCombo = document.getElementById("cat");
				if (searchCombo) {
							searchCombo.title = SelectObj.options[SelectObj.selectedIndex].text;
				}
			}
		}
	}
}


// search option
function searchFormBk(){
	var m_search = "<form style=\"padding:0px;margin:0px;\" name=\"search\" action=\"http://searchapj.dell.com/results.aspx?s=gen&c=kr&l=ko\" method=\"get\" target=\"_blank\"><input type=\"hidden\" name=\"s\" value=\"gen\" ><input type=\"hidden\" name=\"c\" value=\"kr\" ><input type=\"hidden\" name=\"l\" value=\"ko\" ><input type=\"hidden\" name=\"cs\" value=\"\"><div align=\"right\" ><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" ><tr><td><input id=\"searchinput\" title=\"키워드 검색\" class=\"formBdB\" onfocus=\"if(value=='키워드 검색')value='';\" value=\"키워드 검색\" name=\"k\" type=\"text\" size=\"20\"></td><td>&nbsp;<select class=\"formBdB\" id=\"cat\" name=\"cat\" title=\"Search In\"  onchange=\"SetSeachComboTitle(this)\"><option value=\"all\" selected=\"true\">모든 결과</option><option value=\"prod\" >제품</option><option value=\"sup\" >기술 지원</option><option value=\"ans\" >관련 내용 & 솔루션</option><option value=\"abt\" >Dell 관련</option></select>&nbsp;</td><td><a href=\"javascript:document.forms['search'].submit();\"><input onclick=\"if(document.forms['search'].searchinput.value=='키워드 검색')document.forms['search'].searchinput.value='';\" class=\"searchaction\" type=\"image\" border=\"0\" src=\"/images/bt_search_bk.gif\" alt=\"Search\" width=\"24\" height=\"19\" hspace=\"2\" vspace=\"0\"></a></td></tr></table></div></form>";
	if ( typeof( m_supressSearch ) == "undefined" || m_supressSearch == false ) {
	document.write( "<div class=\"searchcontainer\" id=\"searchcontainer\"></div>")
		if( m_search ) {
			document.write( m_search );
		} else {
			renderSearchLinks();
		}
	}
}
// set the title of the search combo
function SetSeachComboTitle (SelectObj) {
if (SelectObj) {
	if (SelectObj.selectedIndex > -1)	{
		if (SelectObj.options[SelectObj.selectedIndex].value != ""){ 
			var searchCombo = document.getElementById("cat");
				if (searchCombo) {
							searchCombo.title = SelectObj.options[SelectObj.selectedIndex].text;
				}
			}
		}
	}
}

// flashDocs
function flashDoc(urL,wiD,heI,iD,wMode,oPtion){
	var urL1;
	if (oPtion == ""){
		urL1 = urL;
	} else {
		urL1 = urL + oPtion;
	}
	var strSWF=
	"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+wiD+"' height='"+heI+"'>"+
	"<param name='movie' value='"+urL1+"'>"+
	"<param name='menu' value='false'>"+
	"<param name='quality' value='high'>"+
	"<param name='wmode' value='"+wMode+"'>"+
	"<embed src='"+urL1+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' menu='false' wmode='"+wMode+"' width='"+wiD+"' height='"+heI+"'></embed>"+
	"</object>";
	// Write Flash Source
	document.write(strSWF);
}

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

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// Jump Menu
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function menuGo(pageNum){
	switch(pageNum){
		case 1: location.href="/server/"; break;
		case 2: location.href="/storage/"; break;
		case 3: location.href="/desktop/"; break;
		case 4: location.href="/latitude/"; break;
		case 5: location.href="/precision/"; break;
		case 6: location.href="/display/"; break;
		case 7: location.href="/prosupport/"; break;
		case 8: location.href="/casestudy/"; break;
		case 9: location.href="http://talk.dellcec.co.kr"; break;
//		case 10: location.href="/promotion/"; break;
		case 10: window.open("/promotion/"); break;
		case 11: location.href="/membership/registration.html"; break;
		case 12: location.href="/membership/"; break;
		case 13: location.href="/company/privacy.html"; break;
		case 14: location.href="/company/termsofuse.html"; break;
		case 15: location.href="/events/"; break;
		default: location.href="/"; break;
	}
}
function menuOn(pageNum){
	switch(pageNum){
/*		case 1: location.href="/server/"; break;
		case 2: location.href="/storage/"; break;
		case 3: location.href="/desktop/"; break;
		case 4: location.href="/notebook/"; break;
		case 5: location.href="/workstations/"; break;
		case 6: location.href="/display/"; break;
		case 7: location.href="/prosupport/"; break;
		case 8: location.href="/casestudy/"; break;
		case 9: location.href="/company/askfor/"; break;  */
		case 10: promoshow(); break;
/*		case 11: location.href="/membership/registration.html"; break;
		case 12: location.href="/company/sitemap.html"; break;
		case 13: location.href="/company/privacy.html"; break;
		case 14: location.href="/company/termsofuse.html"; break;
		case 15: location.href="/events/"; break; */
		default: location.href="/"; break;
	}
}

function promoshow(){
		
}

//openHTML
function openHtm(Method, targetDir, targetPage, sizeH, sizeV){
	if (Method == "pop"){
		url = "/"+targetDir+"/"+targetPage+".html";
		window.open(url,targetPage,"toolbar=no, menubar=no, resizable=yes, location=no, directories=no, status=no, scrollbars=no,width="+sizeH+",height="+sizeV);
	} else {
		url = "/"+targetDir+"/"+targetPage+".html";
		window.open(url);
	}
}

//openHTML
function openHtm2(Method, targetDir, targetPage, sizeH, sizeV){
	if (Method == "pop"){
		url = "/"+targetDir+"/"+targetPage+".html";
		window.open(url,targetPage,"toolbar=no, menubar=no, resizable=no, location=no, directories=no, status=no, scrollbars=no,width="+sizeH+",height="+sizeV);
	} else {
		url = "/"+targetDir+"/"+targetPage+".html";
		window.open(url);
	}
}

// PopUps
function popUps(url, sizeH, sizeV){
		window.open(url,"mxpop","toolbar=no, menubar=no, resizable=yes, location=no, directories=no, status=no, scrollbars=yes,width="+sizeH+",height="+sizeV);
}

//download File
function downlink(pageCode,fname,itemCode){
		url = "/download/trigger.html?pCode="+pageCode+"&file="+fname+"&item="+itemCode;
		window.open(url,"downpop","toolbar=no, menubar=no, resizable=no, location=no, directories=no, status=no, scrollbars=no,width=440,height=369");
}

// print pop
function printPop(url, sizeH, sizeV){
		window.open(url,"mxpop","toolbar=yes, menubar=no, resizable=no, location=no, directories=no, status=no, scrollbars=yes,width="+sizeH+",height="+sizeV);
}

function print_info()
{
 document.getElementById("printzone").value = document.getElementById("printA").innerHTML;
 window.open("/zGlobal_Apps/print.html", "PrintPage","width=676,height=600,top=0,left=0,noresizable,toolbar=no,status=no,scrollbars=yes,directory=no");
}

// DT switch
function showhideDT(a,b,c,d){
	if (a==1){
		document.getElementById("optiplexDT").style.display = "block";
	} else {
		document.getElementById("optiplexDT").style.display = "none";
	}
	if (b==1){
		document.getElementById("vostroDT").style.display = "block";
	} else {
		document.getElementById("vostroDT").style.display = "none";
	}
	if (c==1){
		document.getElementById("inspironDT").style.display = "block";
	} else {
		document.getElementById("inspironDT").style.display = "none";
	}
	if (d==1){
		document.getElementById("xpsDT").style.display = "block";
	} else {
		document.getElementById("xpsDT").style.display = "none";
	}
}

// NB switch
function showhideNB(a,b,c,d){
	if (a==1){
		document.getElementById("latitudeNB").style.display = "block";
	} else {
		document.getElementById("latitudeNB").style.display = "none";
	}
	if (b==1){
		document.getElementById("vostroNB").style.display = "block";
	} else {
		document.getElementById("vostroNB").style.display = "none";
	}
	if (c==1){
		document.getElementById("inspironNB").style.display = "block";
	} else {
		document.getElementById("inspironNB").style.display = "none";
	}
	if (d==1){
		document.getElementById("xpsNB").style.display = "block";
	} else {
		document.getElementById("xpsNB").style.display = "none";
	}
}