<!--
var sendit;


function goURL(url)
{

	location.href = url;
}

function connecting(){
	alert("Waiting please..");
}



function showSelectBox(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}

function hideSelectBox(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}


function goURL(url)
{

	location.href = url;
}

function focusMove(obj,len,nxtObj)
{
	if(obj.value.length >= len)
		$(nxtObj).focus();
}

function SetCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function GetCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ){
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}

function ajaxLoad(ele)
{
	$(ele).startWaiting();
}


function ajaxLoadEnd(ele,n)
{
	$(ele).stopWaiting();
}

function fixNumberScale(number,scale)
{
	var ex = Math.pow(10,scale);
	return Math.round(number * ex);
}

function faqView(pg)
{
	var pars = "LF=" + LF + "&page=" + pg;
	var ajax = new Ajax.Updater (
		"faqLst",
		"/include/faq.asp",
		{
			parameters	: pars
		}
	);
}

var layerOpenFilter = false;
function regEvent_Open(folder)
{
//	if(!eventInt)
//	{
//		alert(eventEndMsg);
//		return false;
//	}
	layerOpenFilter = true;
	if(navigator.appName.indexOf("Opera",0) < 0)
		trackPromotion(1);
	else
	{
		  var _gaq = _gaq || [];
		  _gaq.push(['_setAccount', 'UA-4034729-22']);
		  _gaq.push(['_trackPageview']);

		  (function() {
			var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		  })();

	}
	$("regEventFla").restart();
	eventPopupResize('regEvent');
}

function updateClose() {//close event registration layer
	$("regEvent").style.height = "1px";
	layerOpenFilter = false;
	clearTimeout (st);
	//document.getElementById('regEvent').className='reg-event hide';

	$('swfFull').className='swfFull show';
}

function giftEvent_Open (folder)
{
	$('giftEvent').className='gift-event show';
	if($('swfFull'))
		$('swfFull').className='swfFull hide';
	if(navigator.appName.indexOf("Explorer",0) < 0)
	{
		$('giftEvent').className='gift-event show';
		$('swfFull').className='swfFull show';
	}
	else
	{
		var gifEventDiv = $('giftEvent');
		$('giftEvent').className='gift-event show';
		$('swfFull').className='swfFull show';
		gifEventDiv.innerHTML = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"100%\" height=\"100%\" id=\"giftEventFla\" name=\"giftEventFla\" align=\"middle\">"; 
		gifEventDiv.innerHTML += "<param name=\"allowScriptAccess\" value=\"always\" />"; 
		gifEventDiv.innerHTML += "<param name=\"movie\" value=\"/" + folder + "/flash/gift.swf\" /> "; 
		gifEventDiv.innerHTML += "<param name=\"FlashVars\" value=\"userInfo=/include/userinfo.asp&serverPath=" + DomainName + "\" /> "; 
		gifEventDiv.innerHTML += "<param name=\"menu\" value=\"false\" />"; 
		gifEventDiv.innerHTML += "<param name=\"scaleMode\" value=\"noScale\" />"; 
		gifEventDiv.innerHTML += "<param name=\"showMenu\" value=\"false\" />"; 
		gifEventDiv.innerHTML += "<param name=\"align\" value=\"CT\" /> "; 
		gifEventDiv.innerHTML += "<param name=\"quality\" value=\"high\" />";  
		gifEventDiv.innerHTML += "<param name=\"bgcolor\" value=\"#fff\" />"; 
		gifEventDiv.innerHTML += "<param name=\"base\" value=\"/kr/flash/\" />"; 
		gifEventDiv.innerHTML += "</object>";
	}
	eventPopupResize('giftEvent');
}

function eventPopupResize(ele)
{
	if (layerOpenFilter)
	{
		if(document.body.clientHeight < 650)
		{
			$(ele).style.height = "650px";
		}
		else
		{
			var hei = document.body.clientHeight;
//			alert(hei +"?"+ document.body.scrollHeight);
			$(ele).style.height = hei + "px";
		}
			
		
		st = setTimeout ("eventPopupResize('" + ele + "')",500);
	}
}


function giftEvent_resize()
{
	if(document.documentElement.clientHeight < 650)
	{
		$("giftEvent").style.height = "650px";
	}
	else
	{
		$("giftEvent").style.height = "100%";
	}
	if(st > 0)
		st = setTimeout ("giftEvent_resize()",500);
}

function giftClose(){//close gift layer
	clearTimeout(st);
	$('giftEvent').className='gift-event hide';
	if($('swfFull'))
		$('swfFull').className='swfFull hide'; 
}

function giftCloseAndUpdateOpen(){//open regEvent layer aftering closing giftEvent layer
	giftClose();
	goUpdate();
}

function nationSelect(string){//Select your country
	var string;
	switch (string)	{
	case 'South Korea':
		document.location.href='/kr/';
		break;
	case 'US(English)':
		document.location.href='/us/en/';
		break;
	case 'US(Spanish)':
		document.location.href='/us/es/';
		break;
	case 'Japan':
		document.location.href='/jp/';
		break;
	case 'Russia':
		document.location.href='/ru/';
		break;
	case 'Ukraine':
		document.location.href='/ua/';
		break;
	case 'Dubai':
		document.location.href='/gf/';
		break;
	case 'Republic of South Africa':
		document.location.href='/za/';
		break;
	case 'Czech Republic':
		document.location.href='/cz/';
		break;
	case 'Germany':
		document.location.href='/de/';
		break;
	case 'Singapore':
		document.location.href='/sg/';
		break;
	default:
		document.location.href='/';
	}
}

function goGiftBlank(){
	$('giftEvent').className='gift-event show'; //e
	$('swfFull').className='swfFull show'; //e
}

/* INTRO */
function getLG(){
	document.location.href='/';
}

function getLanguage(code){
	var code;
	switch (code){
	case 1://Korea Korean
		document.location.href='/kr/';
		break;
	case 2://US English
		document.location.href='/us/en/';
		break;
	case 3://US Spanish
		document.location.href='/us/es/';
		break;
	case 4://Republic of South Africa Englsih
		document.location.href='/za/';
		break;
	case 5://Singapore English
		document.location.href='/sg/';
		break;
	case 6://Japan Japnese
		document.location.href='/jp/';
		break;
	case 7://Dubai English
		document.location.href='/gf/';
		break;
	case 8://Ukraine Russian
		document.location.href='/ua/';
		break;
	case 9://Russia Russian
		document.location.href='/ru/';
		break;
	case 10://German Germany
		document.location.href='/de/';
		break;
	case 11://Czech Republic Czesh
		document.location.href='/cz/';
		break;
	default:
		document.location.href='/';
	}
}

/* Teasing Site Footer */
function footMenu(code){
	var code;
	switch (code){
	case 1://privacy
		document.location.href="http://www.lge.com/global/general/privacy.jsp";
		break;
	case 2://legal
		document.location.href="http://www.lge.com/global/general/legal.jsp";
		break;
	default:
	
	}
}


function mainSizeFix()
{
	if(document.documentElement.clientHeight < 650)
	{
		$("mainPageDiv").style.height = "650px";
	}
	else
	{
		var hei = document.body.clientHeight - 10;
		$("mainPageDiv").style.height = hei + "px";
	}
	st = setTimeout ("mainSizeFix()",500);
}

function widgetCopy()
{
	var pars = "mode=Copy&usrname=" + encodeURIComponent($("usrname").value) + "&blogurl=" + encodeURIComponent($("blogurl").value) + "&country=" + encodeURIComponent($("country").value);
	var ajax = new Ajax.Request (
		"/include/widgetCopy.asp",
		{
			parameters	: pars
		}
	);
	trackWidgetInstall('WidgetCopy');
	copytoClipboard($('widget_code').value);
}

var insID = "";
function copyWzd(url,w,h,s)
{
	trackWidgetInstall(s);
	var pars = "mode=" +s;
	var ajax = new Ajax.Request (
		"/include/widgetCopy.asp",
		{
			parameters	: pars,
			onSuccess	: function  (req) {
				insID = req.responseText;
			},
			onComplete : function (){
				var win = window.open (url + "?instanceid=" + insID,"","width=" + w + ", height=" + h);
				if(win)
					win.focus();

			}
		}
	);

}
var curele = 1;

function viralthumb (ele,cls) {
	if(curele != ele)
		$("thumbId0" + ele).className = "li-thumb" + cls + " fl";
}

function chgMovie (no,ele) {
	if (!no)
		return false;
	var pars = "vn=" + no;
	curele = ele;
	for(n=1;n<=6;n++)
	{
		if($("thumbId0" + n))
		{	if(n != curele)
				$("thumbId0" + n).className = "li-thumb fl";
		}
	}
	var ajax = new Ajax.Request(
		"/common/viraldata.asp",
		{
			parameters	: pars,
			onSuccess	: function (req) {
				var html = req.responseText;
				var viralfilms= $('viralfilmsFla');
				$("tmp").update (html);
				var movie = $("movname").value;
				var subj = $("data_subject").value;
				var cont = $("data_description").value;
				viralfilms.flvLoad(movie);
				$("subject_").update (subj);
				$("description_").update (cont);
				$("li-thumb" + ele).className = "li-thumb-ov fl";
				alert($("li-thumb" + ele).className);
			}
		}
	);
}


