// index.js
function MenuS(obj){var el = document.getElementById(obj);el.style.display = "block";}
function MenuR(obj){var el = document.getElementById(obj);el.style.display = "none";}

function getf(Form){if(Form.email.value==''){Form.email.value='Your e-mail here';Form.email.className="i1";}}
function getblank(Form){if(Form.email.value=='Your e-mail here'){Form.email.value='';Form.email.className="i3";}}
function getf1(Form){if(Form.nl_name.value==''){Form.nl_name.value='Your name here';Form.nl_name.className="i1";}}
function getblank1(Form){if(Form.nl_name.value=='Your name here'){Form.nl_name.value='';Form.nl_name.className="i3";}}

function validateit(theForm){
if (theForm.nl_name.value=='Your name here')
{alert("Please fill the name");theForm.nl_name.focus();return (false);}
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theForm.email.value)))
{alert("Kindly enter a valid E-mailID!\nEx:abc@yahoo.com\n      xyz@gmail.com");theForm.email.focus();return (false);}}

function openchild_nl(thisurl){
browserName = navigator.appName;browserVer = parseInt(navigator.appVersion);
condition = !(( (browserName.indexOf("Explorer") >=0 ) && (browserVer < 4) ) ||  ((browserName.indexOf("Netscape") >=0 ) && (browserVer < 2) ) ) ;
if (condition == true)CanAnimate = true;
else CanAnimate = false;
var nl_name = document.theForm.nl_name.value;
var email_val = document.theForm.email.value;var from_site_val = document.theForm.from_site.value;var is_window_val = document.theForm.is_window.value;var org_referer = document.theForm.org_referer.value;var is_im = document.theForm.is_im.value;
var thisurl_string = thisurl + "?email=" + email_val + "&from_site=" + from_site_val + "&is_window=" + is_window_val + "&org_referer=" + org_referer + "&is_im=" + is_im + "&nl_name=" + nl_name;
if ( CanAnimate ){msgWindow=window.open( '' ,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=550,height=340,top=0,left=0');
msgWindow.focus();msgWindow.location.href = thisurl_string;}else {msgWindow=window.open( thisurl_string,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=550,height=340,top=0,left=0');}}


// head-foot.js
function check_advanced_search()
{
	var kw = document.searc.q.value;
	kw = kw.replace(/^\s+|\s+$/g,"");
	if (kw.length < 3)
	{
		error_message = "Please enter atleast 3 characters for search";
		alert(error_message);
		document.searc.q.focus();
		return false;
	}
	return true;
}
function check_advanced_search1()
{
	var kw = document.searc1.q.value;
	kw = kw.replace(/^\s+|\s+$/g,"");
	if (kw.length < 3)
	{
		error_message = "Please enter atleast 3 characters for search";
		alert(error_message);
		document.searc1.q.focus();
		return false;
	}
	return true;
}
//language converter js

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
condition = !(( (browserName.indexOf("Explorer") >=0 ) && (browserVer < 4) ) ||  ((browserName.indexOf("Netscape") >=0 ) && (browserVer < 2) ) ) ;
if (condition == true  )
    CanAnimate = true;
else
    CanAnimate = false;


function convertnew(pattern)
{

/////////////////////////////////////////////////////////////
// Script to use language convertor
// By Rohit
/////////////////////////////////////////////////////////////

	/// Configuration parameters //////////////
	var open_in_same_window = 0;
	//////////// End Of Configuration /////////////

	var my_location = unescape(document.location.toString());
	var new_location ='';
	var new_pattern = '';
	if (my_location.indexOf('translate_c?') != -1) {
		/// From google...
		var indexof_u = my_location.indexOf('u=');
		if (indexof_u == -1) {
			new_location = document.location;
		}
		else {
			var subs = my_location.substring(indexof_u, my_location.length);
			var ss = subs.split('&');
			new_location = ss[0].substring(2, ss[0].length);
		}
	}
	else {
		new_location = document.location;
	}

	indexof_p = pattern.indexOf('|');

	var isen = '';
	if (indexof_p == -1) {
		indexof_p1 = pattern.indexOf('><');
		if (indexof_p1 == -1) {
			new_pattern = pattern;
			if (pattern == 'en') {
				isen = 1;
			}
		}
		else {
			var psplit =pattern.split('><');
			new_pattern = psplit[0]+'|'+psplit[1];
			if (psplit[1] == 'en') {
				isen = 1;
			}
		}
	}
	else {
		var psplit = pattern.split('|');
		new_pattern = psplit[0]+'|'+psplit[1];
		if (psplit[1] == 'en') {
			isen = 1;
		}
	}

	var thisurl = '';
	if (isen == 1) {
		thisurl = new_location;
	}
	else {
		thisurl = 'http://translate.google.com/translate_c?langpair=' + new_pattern + "&u=" + new_location;
	}

	if (open_in_same_window == 1) {
		window.location.href = thisurl;
	}
	else {
		if (CanAnimate ){
			msgWindow=window.open('' ,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
			msgWindow.focus();
			msgWindow.location.href = thisurl;
		}
		else {
			msgWindow=window.open(thisurl,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
		}
	}
}


// mediaserver.js

var mediaserver_height="";
var mediaserver_width="";
var mediaserver_location="";
var mediaserver_contenttype="";
var mediaserver_id="";
var mediaserver_uname="";
var mediaserver_comp="";
var mediaserver_mcat="";
var mediaserver_cat="";
var mediaserver_grp="";
var mediaserver_cmpg="";
var mediaserver_kwd="";
var mediaserver_otherparam="";
var mediaserver_nomore=0;
var mediaserver_noadv=0;
var mediaserver_newwin=0;
var mediaserver_paidonly=0;
var mediaserver_useiframe=0;
var mediaserver_parentwindow=0;


function serve_ad(mycompid)
{

	var mediaserver_ad_url = 'http://www.media4trade.com/mediaserver?';
	var mediaserver_size = mediaserver_width+'x'+mediaserver_height;
	
	var mediaserver_pageurl;
	if(mediaserver_parentwindow == 1)
	{
		mediaserver_pageurl = parent.document.location;
	}
	else
	{
		mediaserver_pageurl = document.location;
	}
	

	mediaserver_ad_url += 'action=show';
	mediaserver_ad_url += '&pageurl=' + encodeURIComponent(mediaserver_pageurl);
	mediaserver_ad_url += '&location=' + mediaserver_location;
	mediaserver_ad_url += '&kwd=' + encodeURIComponent(mediaserver_kwd);
	mediaserver_ad_url += '&size=' + mediaserver_size;
	mediaserver_ad_url += '&contenttype=' + mediaserver_contenttype;
	mediaserver_ad_url += '&id=' + mediaserver_id;
	mediaserver_ad_url += '&uname=' + mediaserver_uname;
	
	if(mycompid)
	{
		mediaserver_ad_url += '&comp=' + mycompid;
	}
	else
	{
		mediaserver_ad_url += '&comp=' + mediaserver_comp;
	}
	
	mediaserver_ad_url += '&mcat=' + mediaserver_mcat;
	mediaserver_ad_url += '&cat=' + mediaserver_cat;
	mediaserver_ad_url += '&grp=' + mediaserver_grp;
	mediaserver_ad_url += '&cmpg=' + mediaserver_cmpg;
	mediaserver_ad_url += '&otherparam=' + encodeURIComponent(mediaserver_otherparam);
	mediaserver_ad_url += '&nomore=' + mediaserver_nomore;
	mediaserver_ad_url += '&noadv=' + mediaserver_noadv;
	mediaserver_ad_url += '&newwin=' + mediaserver_newwin;
	mediaserver_ad_url += '&paidonly=' + mediaserver_paidonly;

	if(mediaserver_contenttype == 'prdbanner') {mediaserver_noadv = 1;}
	
	if(mediaserver_useiframe)
	{
		if(!mediaserver_noadv)
		{
			mediaserver_height = parseInt(mediaserver_height)+20;
		}

		mediaserver_ad_url += '&iframe=1';
		document.write('<center><ifr'+'ame id="'+mediaserver_location+'" src="' + mediaserver_ad_url + '" width="'+mediaserver_width+'" height="'+mediaserver_height+'" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" target="_top"></ifr'+'ame></center>');
	}
	else
	{
		mediaserver_ad_url += '&iframe=0';
		document.write('<center><scr'+'ipt type="text/javascript" src="' + mediaserver_ad_url + '"></scr'+'ipt></center>');
	}
}


















function google_ad_request_done(google_ads) {
	/*
	* This function is required and is used to display
	* the ads that are returned from the JavaScript
	* request. You should modify the document.write
	* commands so that the HTML they write out fits
	* with your desired ad layout.
	*/
	var s = '';
	var i;
	
	/*
	* Verify that there are actually ads to display.
	*/
	if (google_ads.length == 0) {
	return;
	}
	
	/*
	* If an image or flash ad is returned, display that ad.
	* Otherwise, build a string containing all of the ads and
	* then use a document.write() command to print that string.
	*/
	
	if (google_ads[0].type == "text") {
	
		if (google_ads.length == 1) {
		/*
		* Partners should adjust text sizes
		* so ads occupy the majority of ad space.
		*/
		s += '<DIV style="width:212px; height:22px; text-align:left;"><a href=\"' + google_info.feedback_url + '\" style="font-family:arial; font-size:11px;color:#949494;  padding-right:8px; text-decoration:none;">Ads by Google</a></DIV><DIV style="border:1px #DDF0F7 solid; padding:8px 5px 8px 5px;margin:0px 5px 10px 0px; width:205px;"><a style="font-family:arial;font-size:18px; color:#FF4200; font-weight:bold;margin-top:3px;" href="' +
		google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[0].visible_url + '\';return true">' +
		google_ads[0].line1 + '</a> <br><span style="font-family:arial; font-size:14px; color:#1E3589;">' +
		google_ads[0].line2 + '&nbsp;' +
		google_ads[0].line3 + '<br></span> <span><a style="font-family:arial;font-size:12px; font-weight:bold;color:#333333;" href="' +
		google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[0].visible_url + '\';return true">' +
		google_ads[0].visible_url + '</span></a></DIV>';
		
		} else if (google_ads.length > 1) {

			s += '<DIV style="width:212px; height:22px; text-align:left; "><a href=\"' + google_info.feedback_url + '\" style="font-family:arial; font-size:11px;color:#949494; padding-right:8px; text-decoration:none;">Ads by Google</a></DIV>';
			/*
			* For text ads, append each ad to the string.
			*/
			
			for(i = 0; i < google_ads.length; ++i) {
			
			s += '<DIV style="padding:8px 5px 8px 5px;margin:0px 5px 10px 0px; width:205px;"><a style="font-family:arial;font-size:14px; color:#1E3589; font-weight:bold;margin-top:3px;" href="' +
			google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[i].visible_url + '\';return true">' +
			google_ads[i].line1 + '</a><br><span style="font-family:arial; font-size:12px; color:#333333;">' +
			google_ads[i].line2 + ' ' +
			google_ads[i].line3 + '<br></span> <span><a style="font-family:arial;font-size:11px;color:#158f01;" href="' +
			google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[i].visible_url + '\';return true">' +
			google_ads[i].visible_url + '</span></a></DIV>';
			}
		}
		if (google_ads[0].bidtype == "CPC")
		{
			/* insert this snippet for each ad call */
			google_adnum = google_adnum + google_ads.length;
		}
	}

    document.write(s);
    return;
}


function gl()
{
google_ad_client = 'pub-8525015516580200'; // substitute your client_id (pub-#)
google_ad_channel = ad_channel;
google_ad_output = 'js';
google_max_num_ads = ads_count;
google_ad_type = 'text';
google_feedback = 'on';
google_skip = google_adnum; /* insert this snippet for each ad call */
}
