// JavaScript Document
<!-- //  X Player
// CN Webpage PLAY Template
function QueryString(key)
{
	var value = null;
	for (var i=0;i<QueryString.keys.length;i++)
	{
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];
			break;
		}
	}
	return value;
}
QueryString.keys = new Array();
QueryString.values = new Array();

function QueryString_Parse()
{
	var query = window.location.search.substring(1);
	var pairs = query.split("&");
	
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;		
		}
	}

}
QueryString_Parse();


function Backgroundqs_style() {
	var a1 = '<link rel="stylesheet" type="text/css" href="http://www.quickshow.com/templates/web/styles/cn_web.css">'
	
	document.write(a1)
}
Backgroundqs_style();
// write Table with query string
function writeTable(h,d,q,ps,l1,name1,name2,phone1,phone2,email1,email2,image1,image2,stripe,website,panel) {
	var undefined;
	
	// CN Play once per page
	var play_status;
	var action = QueryString('action')
		if (action == undefined) {
			play_status = 'playing'
		}
		else if (action > '') {
			play_status = 'stop'
		}
		else {
			play_status = 'playing'
		}

	// appearance vars, these can be customized to your liking
	var width = '375'
	var height = '230'
	var src = 'http://'+h+'/show/users/w/wrap854x480small.swf'
	// queries -- type in the variables you want to send to flash here
	var queries = '?host='+h+'&dir='+d+'&quickshow='+q+'&link='+l1+'&endPlayStatus='+ps+'&play_status='+play_status+''
	
	if (stripe == "white") {
			var logocolor = 'black'
		}
	else {
			var logocolor = 'white'
		}

	// assemble Table
	var t1 = '<table id="QS-Table01" width="620" height="218" border="0" cellpadding="0" cellspacing="0">  <tr>    <td colspan="3"><img src="http://www.quickshow.com/templates/email/images/cn_email-01_01.gif" width="53" height="20" alt=""></td>    <td colspan="2"><img src="http://www.quickshow.com/templates/email/images/cn_email-01_02.gif" width="514" height="20" alt=""></td>    <td colspan="2"><img src="http://www.quickshow.com/templates/email/images/cn_email-01_03.gif" width="53" height="20" alt=""></td>  </tr>  <tr>    <td height="275" rowspan="2"><img src="http://www.quickshow.com/templates/email/images/cn_email-01_04.gif" width="15" height="100%" alt=""></td>    <td colspan="5" align="center" valign="middle" background="http://www.quickshow.com/templates/web/images/stripes/'+panel+'.gif">'
	var l1 = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'" align="absmiddle">'
	var l2 = '<param name="movie" value="'+src+queries+'" />'
	var l3 = '<param name="quality" value="high" /><param name="SCALE" value="exactfit" /><param name="WMODE" value="transparent" />'
	var l4 = '<embed src="'+src+queries+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+' scale="exactfit"></embed>'
	var l5 = '</object>'
	var t2 = '</td>    <td height="275" rowspan="2"><img src="http://www.quickshow.com/templates/email/images/cn_email-01_07.gif" width="15" height="100%" alt=""></td>  </tr>  <tr>    <td colspan="5"><table width="100%" height="50" background="http://www.quickshow.com/templates/web/images/stripes/'+stripe+'-stripe.png">      <tr>        <td width="338" valign="bottom" class="qs_style12">powered by:<br><a href="http://www.quickshow.com"><span class="qs_style13">QUICKSHOW </span></a></td>        <td><div align="center"><a href="http://www.quickshow.com"><img src="http://www.quickshow.com/templates/web/images/logos/cn-logo-'+logocolor+'.png" width="136" height="42" alt"Powered by: Quickshow" border="0"></a></div></td>      </tr>    </table></td>  </tr>  <tr>    <td colspan="3"><img src="http://www.quickshow.com/templates/email/images/cn_email-01_09.gif" width="53" height="20" alt=""></td>    <td colspan="2"><img src="http://www.quickshow.com/templates/email/images/cn_email-01_10.gif" width="514" height="20" alt=""></td>    <td colspan="2"><img src="http://www.quickshow.com/templates/email/images/cn_email-01_11.gif" width="53" height="20" alt=""></td>  </tr>  <tr>    <td height="2"><img src="spacer.gif" width="15" height="1" alt=""></td>    <td><img src="spacer.gif" width="8" height="1" alt=""></td>    <td><img src="spacer.gif" width="30" height="1" alt=""></td>    <td><img src="spacer.gif" width="300" height="1" alt=""></td>    <td><img src="spacer.gif" width="214" height="1" alt=""></td>    <td><img src="spacer.gif" width="38" height="1" alt=""></td>    <td><img src="spacer.gif" width="15" height="1" alt=""></td>  </tr></table>'

	    // pre load images
	image_1 = new Image()
   	image_1.src = image1
    image_2 = new Image()
   	image_2.src = image2	
	
	// Scale Images
	var x2;
	var x3;
	var y2;
	var y3;
	var c1;
	var c2;
	if (image_1.height > image_1.width) {
		y2 = 100
		c1 = image_1.height / y2
		x2 = image_1.width / c1
	}
	else if (image_1.height < image_1.width) {
		x2 = 80
		c1 = image_1.width / x2
		y2 = image_1.height / c1
	}
	else if (image_1.height > 0 && image_1.height == image_1.width) {
		x3 = 80
		y3 = 80
	}	
	else {
		x2 = 75
		y2 = 100
	}	
	
	if (image_2.height > image_2.width) {
		y3 = 100
		c2 = image_2.height / y3
		x3 = image_2.width / c2
	}
	else if (image_2.height < image_2.width) {
		x3 = 80
		c2 = image_1.width / x3
		y3 = image_1.height / c2
	}	
	else if (image_2.height > 0 && image_2.height == image_2.width) {
		x3 = 80
		y3 = 80
	}
	else {
		x3 = 75
		y3 = 100
	}

	if (x2 == undefined) {
		x2 = 75
		y2 = 100
	}
	if (x3 == undefined) {
		x3 = 75
		y3 = 100
	}
	
	// write images to table
	var imgsource= 'http://'+h+'/show/users/'+d+'/'

	if (image1 == imgsource || image1 == '') {
		var ifimage1 = ''
	}
	else {
		var ifimage1 = '<img src="'+image1+'" alt="'+name1+'" width="'+x2+'" height="'+y2+'" hspace="2" vspace="2">'
	}
	if (image2 == imgsource || image2 == '') {
		var ifimage2 = ''
	}
	else {
		var ifimage2 = '<img src="'+image2+'" alt="'+name2+'" width="'+x3+'" height="'+y3+'" hspace="2" vspace="2">'
	}
	var allimages = ''+ifimage1+''+ifimage2+''

	if (name2 == "") {
		var agent2 = ''
	}
	else if (name2 == "null") {
		var agent2 = ''
	}
	else {
		var agent2 = '<br><img src="http://www.quickshow.com/images/1x1.gif" name="bar" width="100%" height="1" vspace="3" id="bar"><br><strong>'+name2+'</strong><br>'+phone2+'<br><span class="qs_style9"><a href="mailto:'+email1+'">'+email2+'</a></span>'
	}

	// website title length
	if (website.length > 22) {
	var website_2 = '<table width="100%" background="http://www.quickshow.com/templates/web/images/shadow-bar.png"><tr><td><div align="center" class="qs_style1"><a href="http://'+website+'">'+website+'</a></div></td></tr></table>'
	var website_1 = ''
	}
	else {
	var website_1 = '<div align="center" class="qs_style1"><a href="http://'+website+'">'+website+'</a></div>'
	var website_2 = ''
	}

// write content table
	var nametable = ''+website_2+'<table width="100%"><tr><td width="375" align="center" valign="middle"><div align="center">'+l1+''+l2+''+l3+''+l4+''+l5+'</div></td>    <td align="center"><table width="100" align="center">      <tr>        <td>'+website_1+'</td>      </tr>      <tr>        <td><span class="qs_style9">is sponsored by: </span></td>      </tr>      <tr>        <td><div align="center">'+allimages+'        </div></td>      </tr>      <tr>        <td class="qs_style10"><strong>'+name1+'</strong><br>          '+phone1+'<br>          <span class="qs_style9"><a href="mailto:'+email1+'">'+email1+'</a></span>'+agent2+'</td>      </tr>    </table></td>  </tr></table>'


	var qs_stat_project=3;
	var qs_name = document.title;
	var qs_urlid_temp = escape(window.location);
	var qs_urlid = qs_urlid_temp.replace(/%26/g,"&");

	var qs_stats = '<script type="text/javascript">var a_vars = Array();var pagename="Quicskhows^'+qs_name+'^'+qs_urlid+'";var phpmyvisitesSite = '+qs_stat_project+';var phpmyvisitesURL = "http://stats.quickshow.com/phpmyvisites.php";</script><script language="javascript" src="http://stats.quickshow.com/phpmyvisites.js" type="text/javascript"></script>'


// write all lines
	document.write(t1+nametable+t2+qs_stats)
	//document.write(t1+nametable+t2)
}

function qstracker() {

	var project=1648198;
	var security="b89312eb";
	var partition=15;

<!-- Start of StatCounter Code -->

var sourceline = '<!-- Start of StatCounter Code --><script type="text/javascript" language="javascript">var sc_project='+project+'; var sc_invisible=1; var sc_partition='+partition+'; var sc_security="'+security+'"; var sc_remove_link=1; </script><script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><img  src="http://c13.statcounter.com/counter.php?sc_project='+project+'&java=0&security='+security+'&invisible=1" alt="web statistic" border="0"> </noscript><!-- End of StatCounter Code -->'

document.write(sourceline)

}
qstracker();
<!-- End of StatCounter Code -->
