var langPath = (window.location.href.indexOf('/html/') > 0 ) ? '/html/':'/zh-hk/';

function leftContent(){
             
	MM_preloadImages(langPath+'images/left_member_login_help_o.gif',langPath+'images/left_member_login_btn_o.gif')
	var html="";
	
	
	 // MP3 Player
	if ( mstrPageCode == 'HOME' ){
		document.write('<div id="playlistDiv"><p id="mp3player" style="font-family:Arial, Helvetica, sans-serif; font-size:10px;">Please wait a moment.<br/><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a></p></div><br/>');
	}
	
	
	
	
	 // Events and News
	html +="<img src=" + langPath + "images/left_eventNews_title.gif width=187 height=20><img src=/html/images/spacer.gif width=100% height=10><br>";
   
   // this is news 119
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>17.10.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=http://www.love-da-records.com/html/album_info.php?id=3928><img src=/html/whatsNews/2011/mogwai_2011.jpg border=0></a></p>" //Main Image	e
   html +="<a href=http://www.love-da-records.com/html/album_info.php?id=3928><p align=center>Hardcore Will Never Die, But You Will</p></a>";
   html +="</td></tr></table>";  
   
  // this is news 117
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>17.8.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=http://www.love-da-records.com/html/WellWellWellDub.php><img src=/html/whatsNews/2011/0414/image003.jpg border=0></a></p>" //Main Image	e
   html +="<a href=http://www.love-da-records.com/html/WellWellWellDub.php><p align=center>Free MP3: Grace Jones 'Well Well Well Dub'</p></a>";
   html +="</td></tr></table>";     
  
 
// this is news 115
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>7.7.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=news.php><img src=/html/whatsNews/2010/1019/145539.jpg border=0></a></p>" //Main Image	e
   html +="<a href=news.php><p align=center>Housse de Racket upcoming album  Alesia</p></a>";
   html +="</td></tr></table>";        
  
   /*
   
   // this is news 118
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>12.10.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><img src=/html/whatsNews/2011/the_human_league_adv.jpg border=0></a></p>" //Main Image	e
   html +="<a href=http://www.love-da-records.com/html/album_info.php?id=4149><p align=center>Credo link</p></a>";
   html +="</td></tr></table>";  
	
   // this is news 116
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>22.7.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=http://www.love-da-records.com/html/GIRLS.php><img src=/html/whatsNews/2011/0414/130005.jpg border=0></a></p>" //Main Image	e
   html +="<a href=http://www.love-da-records.com/html/GIRLS.php><p align=center>GIRLS VOMIT MP3 GIVEAWAY and streaming</p></a>";
   html +="</td></tr></table>";    

   // this is news 114
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>15.5.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<a href=https://www.facebook.com/#!/event.php?eid=152193631511868&closeTheater=1><p align=center><img src=/html/whatsNews/2010/1019/drums.jpg border=0></a></p>" //Main Image	e
   html +="<a href=https://www.facebook.com/#!/event.php?eid=152193631511868&closeTheater=1><p align=center>The Drums Live 26 May 2011</p></a>";
   html +="</td></tr></table>";    
       
   // this is news 113
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>7.4.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=news.php><img src=/html/whatsNews/2010/1019/Low_Res_Album_Pack_Shot.jpg border=0></a></p>" //Main Image	e
   html +="<a href=news.php><p align=center>MAMAS GUN sophomore album! Check out EPK 2011</p></a>";
   html +="</td></tr></table>";    
      
   // this is news 112
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>30.3.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=news.php><img src=/html/whatsNews/2010/1019/DIGITALISM_pressphoto_RichieCarver1.jpg border=0></a></p>" //Main Image	e
   html +="<a href=news.php><p align=center>DIGITALISM announces new album on June 20th!</p></a>";
   html +="</td></tr></table>";    

   // this is news 111
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>24.3.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=news.php><img src=/html/whatsNews/2010/1019/130715.jpg border=0></a></p>"; //Main Image	e
   html +="<a href=news.php><p align=center>Buy ALL YOU NEED IS NOW to win these fab merch!</p></a>";
   html +="</td></tr></table>";    
            
   // this is news 110
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>4.3.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=news.php><img src=/html/whatsNews/2010/1019/duranduran.jpg border=0></a></p>"; //Main Image	e
   html +="<a href=news.php><p align=center>'All You Need Is Now' INTERVIEW and VIDEO!</p></a>";
   html +="</td></tr></table>";    

      
   // this is news 109
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>14.2.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=news.php><img src=/html/whatsNews/2010/1019/grammy2010.jpg border=0></a></p>"; //Main Image	e
   html +="<a href=news.php><p align=center>Black Keys win 3 Grammy Awards!</p></a>";
   html +="</td></tr></table>"; 

    // this is news 108
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>21.1.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=news.php><img src=/html/whatsNews/2010/1019/153816.jpg border=0></a></p>"; //Main Image	e
   html +="<a href=news.php><p align=center>Peter Bjorn And John announce album title</p></a>";
   html +="</td></tr></table>"; 


	// this is news 107
  
   html +="<table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
   html +="<td class=leftContent>18.1.2011</td>"; // News Date
   html +="<td width=130 background=images/left_eventNews_top_bg.gif>&nbsp;</td></tr></table>"; 
   html +="<img src=images/spacer.gif width=100% height=5><br>";
   html +="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td align=left valign=top class=leftContent>";
   html +="<p align=center><a href=news.php><img src=/html/whatsNews/2010/1019/18172106.jpg border=0></a></p>"; //Main Image	e
   html +="<a href=news.php><p align=center>Brits Awards 2011 - Mumford and Sons + The Temper Trap nominations</p></a>";
   html +="</td></tr></table>"; 
   
   
	*/
	
	document.write(html);
}


/*
 * Post a form using AJAX
 * url - the page to handle submit.
 * parameters - the parameters to submit
 * funStr - a script to handle the XMLHttpRequest state change, the XMLHttpRequest Object named "http_request".
 */
function makePOSTRequest(url, parameters, funcStr) {
	http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/html');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		alert('Cannot create XMLHTTP instance');
		return false;
	}
	
	http_request.onreadystatechange = function(){eval(funcStr);};
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http_request.setRequestHeader("Content-length", parameters.length);
	http_request.setRequestHeader("Connection", "close");
	http_request.send(parameters);
}

/*
 * Form a parameters string from a Form object.
 * obj - a html form.
 */
function getParamsStr(obj) {
	var getstr = "";
	
	var objList = obj.getElementsByTagName("input");
	if ( objList ){
		for (i=0; i<objList.length; i++) {
			if ((objList[i].type == "text") || (objList[i].type == "hidden") || (objList[i].type == "password")) {
				getstr += (objList[i].name + "=" + objList[i].value + "&");
			} else if ( objList[i].type == "checkbox" ){
				getstr += (objList[i].name + "=" + ((objList[i].checked) ? objList[i].value : '') + "&");
			} else if ( (objList[i].type == "radio") && objList[i].checked ){
				getstr += (objList[i].name + "=" + objList[i].value);
			}
		}
	}
	
	var selectList = obj.getElementsByTagName("select");
	if ( selectList ){
		for (i=0; i<selectList.length; i++) {
			getstr += (selectList[i].name + "=" + selectList[i].value + "&");
		}
	}
	
	for (i=0; i<obj.getElementsByTagName("textarea").length; i++) {
		getstr += obj.getElementsByTagName("textarea")[i].name + "=" + 
		escape(encodeURI(obj.getElementsByTagName("textarea")[i].value)) + "&";
	}
	return getstr;
}


/*
 * To Submit a form by Ajax
 * from - is a HTML Form Object
 * funcStr - is a javascript to be execute when callback.
 */
function ajaxFormSubmit( formObj, funcStr ){
	if ( (formObj) && (formObj.tagName == 'FORM')){
		var params = getParamsStr( formObj );
		makePOSTRequest( formObj.action, params, funcStr );
	}
	
	return false;
}

function evalScripts(scripts)
{	
	try
	{	if(scripts != '')	
		{	var script = "";
			scripts = scripts.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function(){
				if (scripts !== null) script += arguments[1] + '\n';
					return '';
			});
			if(script) (window.execScript) ? window.execScript(script) : window.setTimeout(script, 0);
		}
		return false;
	}
	catch(e)
	{
		alert(e)
	}
}

function handleResponse( http_request ){
	if (http_request.readyState == 4) {
		if (http_request.status == 200){
			var obj = document.getElementById('loginFromArea');
			obj.innerHTML = http_request.responseText ;
			evalScripts( http_request.responseText );
		}
	}
}

// Login 

function login( prefix ){
	var noErr = true;
	var obj = document.getElementById( prefix + 'username');
	if ( !(obj) || (obj.value.length == 0) ){
		alert('Please enter username!');
		noErr = false;
	}
	if ( noErr ){
		obj = document.getElementById( prefix + 'password');
		if ( !(obj) || (obj.value.length == 0) ){
			alert('Please enter password!');
			noErr = false;
		}
	}
	if ( noErr ){
		ajaxFormSubmit(document.getElementById( prefix + 'Form'), 'handleResponse( http_request );');
	}
	return noErr;
}

leftContent();
makePOSTRequest( langPath + 'login.php', 'init=true', 'handleResponse( http_request );');


             		 

