function search(url){
var qryName = new Array();
 var qryValue = new Array();
 var toParseArray = new Array();
 var camp_str='';
url = url.substr(url.indexOf("?")+1);

 toParseArray = url.split("&");
 if(toParseArray.length == 0 && url!="") toParseArray[0]=url

 for(var i = 0; i < toParseArray.length; i++){
    qryName[i] = toParseArray[i].substr(0,toParseArray[i].indexOf("=")).replace(/\+|space/gi," ");
    qryValue[i] = toParseArray[i].substr(toParseArray[i].indexOf("=")+1).replace(/[+]/g," ");

    if (qryName[i] =="chm"){
	camp_str = "&chm="+qryValue[i];

    }
  }
 return camp_str;
}
function ExtractQryStr() {
var camp_str='';
var url = '';
if(window.location!=null)
	url=window.location.href;
	if(url!=""){
		camp_str=search(url);
	}
 	if(camp_str!=""){
		return camp_str;
	}
 return camp_str;
}


camp_addon = ExtractQryStr();

function HideStatus(){
	window.status = document.readyState!="complete" ?
		"Loading..." : window.defaultStatus;
}
document.onreadystatechange = HideStatus;
var cururl = '';
if(window.location.href.indexOf("?") != -1) 
{
	cururl =  window.location.href.substr(0,window.location.href.indexOf("?"));
} else {
	cururl = window.location.href;
}

function featured_template1(){
var addr = '';
addr = 'http://' + 'www.mytemplatestorage.com' + '/interface.php?' + 'aff=baycentric&bgcolor=%23FFFFFF&skin=21&sp=0&ft=1&ftt=1&pr=yes&src=yes&nt=no' + '&callfrom='+cururl + camp_addon + '&ref=';

document.write('<IFRAME src="'+addr+'"  width="175" height="205" frameborder="0" ></IFRAME>');
}
function featured_template2(){
var addr = '';
addr = 'http://' + 'www.mytemplatestorage.com' + '/interface.php?' + 'aff=baycentric&bgcolor=%23FFFFFF&skin=21&sp=0&ft=2&ftt=1&pr=yes&src=yes&nt=no' + '&callfrom='+cururl + camp_addon + '&ref=';

document.write('<IFRAME src="'+addr+'"  width="175" height="205" frameborder="0" ></IFRAME>');
}
function featured_template3(){
var addr = '';
addr = 'http://' + 'www.mytemplatestorage.com' + '/interface.php?' + 'aff=baycentric&bgcolor=%23FFFFFF&skin=21&sp=0&ft=3&ftt=1&pr=yes&src=yes&nt=no' + '&callfrom='+cururl + camp_addon + '&ref=';

document.write('<IFRAME src="'+addr+'"  width="175" height="205" frameborder="0" ></IFRAME>');
}

//Templates part 
var affInterfaceOptions = 'aff=baycentric&skin=22&cols=3&rows=9&shop=n2-blue&currency=0&locale=en';

function IncludeAffInterface(options,file){
	if(!file) file = 'interface';
	options = affInterfaceOptions + (options ? '&'+options : '');
	document.write('<SCRIPT type="text/javascript" language="JavaScript" src="http://www.mytemplatestorage.com/codes/'+file+'.php?'+options+'"><'+'/SCRIPT>');
}

function Popup(url){
	window.open(
		url,
		'window',
		'width=600, height=600, resizable=yes, scrollbars=yes, location=no,  toolbar=no, menubar=no, status=no'
	);
}
// Hide "www.mytemplatestorage.com" from status bar
function HideStatus(){
	window.status = document.readyState!="complete" ?
		"Loading..." : window.defaultStatus;
}
document.onreadystatechange = HideStatus;





