
function print_serp (serp, kw, path){
	
	if (serp == 'google'){
		t_logo = path + '/images/logo_google.gif';
		t_link = 'http://www.google.com/search?q=' + escape(kw) + '&hl=de&filter=0';
		t_alt = 'Google SERP for ' + kw;
		return print_serp_link(t_logo, t_link, t_alt);
	}
	
	else if (serp == 'yahoo'){
		t_logo = path + '/images/logo_yahoo.gif';
		t_link = 'http://search.yahoo.com/search?p=' + escape(kw) +' &ei=UTF-8&fr=fp-top&fl=0&vc=&x=wrt&meta=vl%3D';
		t_alt = 'Yahoo! SERP for ' + kw;
		return print_serp_link(t_logo, t_link, t_alt);
	}
	
	else if (serp == 'msn'){
		t_logo = path + '/images/logo_msn.gif';
		t_link = 'http://search.msn.com/results.aspx?q=' + escape(kw);
		t_alt = 'MSN SERP for ' + kw;
		return print_serp_link(t_logo, t_link, t_alt);
	}

}

function print_serp_link (t_logo, t_link, t_alt){
	return '<a href="javascript:openWin(' + "'" + t_link + "'" + ')" title="' + t_alt + '"><img src="' + t_logo + '" border=0 alt="' + t_alt + '" width=16 height=16 align=absmiddle></a>';
}


function openWin(url){
	window.open(url);
}


function openWinSeoChart( href ) {
	
	var SEO_win_width = 500;
	var SEO_win_height = 360;
	
	var Screen_Width = screen.availWidth;
	var new_x = (Screen_Width / 2)-(SEO_win_width / 2);

	var wndhr = window.open( 'about:blank','bmpr_win','top=50,left=' + new_x + ',width=' + SEO_win_width + ',height=' +SEO_win_height+ ',dependent=yes,hotkeys=no,locationbar=no,menubar=no,resizable=yes,scrollbars=no');
	wndhr.location.href = href;
	if ( wndhr.opener == null ){
		wndhr.opener = window;
	}
	wndhr.focus();
}


function moveContent(div_name, div_width){


	//contentObj = eval('document.all.' + div_name); 
	contentObj = document.getElementById(div_name);
	
	//contentObj.style.border = "solid silver 1px";
	contentObj.style.width = div_width + "px";

	maxWidth = document.body.clientWidth;
	newPos = 0;
	
	if(maxWidth > div_width){
		newPos = (maxWidth - div_width) / 2;
	}
	
	//contentObj.style.left = Math.floor(newPos);
	//contentObj.style.top = 10;
	//alert(Math.floor(newPos));
	
	//contentObj.align = center;
	
}

function fillFormField(form_name, form_field, user_link){

	fld = eval('document.' + form_name + '.' + form_field);
	fld.value = user_link;
	

}



function lv_code_set_data(form_name, form_field, data, style){
	
	fld = eval('document.' + form_name + '.' + form_field);
	fld.value = data;
	if (style){
		fld_style = eval('document.' + form_name + '.vl_style');
		fld_style.value = style;
	}
	else{
		fld_style = eval('document.' + form_name + '.vl_style');
		style = fld_style.value;
	}

	lv_code_gen(form_name);
}	

function lv_code_gen(form_name){

	fld = eval('document.' + form_name + '.html_code');

	fld_color = eval('document.' + form_name + '.vl_color');
	fld_style = eval('document.' + form_name + '.vl_style');
	fld_cat = eval('document.' + form_name + '.vl_cat');
	

	
	if (fld_style.value == 10 ){
		fld_txt = eval('document.' + form_name + '.data_text_' + fld_color.value);
		fld.value = '<img src="http://lv.boost-my-pr.com/?color=' + fld_color.value + '&cat=' + fld_cat.value + '&style=' + fld_style.value +'" border="0" width="1" height="1" alt="Webmaster Tools & LinkWert :: Linktausch :: Suchmaschinenoptimierung :: Ranking Charts"><a href="http://www.boost-my-pr.com/" target="_blank" title="LinkWert Berechnung :: Kostenlose SEO Tools für Webmaster :: Linktauch :: Suchmaschinenoptimierung :: RankingCharts">' + fld_txt.value + '</a>'
	}
	else{
		if ( fld_style.value == 1){
			this_width = 54;
			this_height = 30;
		}
		else if  ( fld_style.value == 2){
			this_width = 30;
			this_height = 15;
		}
		else{
			t_url = 'http://www.boost-my-pr.com/';
		}
		
		
		t_url = 'http://www.boost-my-pr.com/';
		fld.value = '<a href="' + t_url + '" target="_blank" title="LinkWert & Webmaster Tools :: Linktausch :: Suchmaschinenoptimierung :: Ranking Charts"><img src="http://lv.boost-my-pr.com/?color=' + fld_color.value + '&cat=' + fld_cat.value + '&style=' + fld_style.value +'" border="0" width="' + this_width + '" height="' + this_height + '" title="www.Boost-My-Pr.com :: LinkWert Berechnung - Tools für Webmaster & SEOs - Suchmaschinenoptimierung - RankingCharts - Linktausch"></a>'
	}
	

}




function LoadJavaScript(file_url){
	var script_element=document.createElement("script"); 
	script_element.type="text/javascript"; 
	script_element.src= file_url; 
	var heads=document.getElementsByTagName("head"); 
	heads[0].appendChild(script_element); 
}


function LoadJavaScript__(file_url){ 
	if( document.createElement ){ 
		var scriptElement = document.createElement( "script" ); 
		scriptElement.setAttribute( "src", file_url ); 
		document.body.appendChild( scriptElement ); 
	} 
} 
