﻿function adFlash(width, height, wmode, url, clss, style, param)
{
	var html;
	
	if(!wmode)
	  wmode = "opaque";
	
	html='<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"' + width + '\" height=\"' + height + '\"';
	if(clss!=null) html+=' class=\"' + clss + '\"';
	if(style!=null) html+=' style=\"' + style + '\"';
	html+='>';
	html+='<param name=\"movie\" value=\"' + url + '\">';
    html+='<param name=\"quality\" value=\"high\">';
    html+='<param name=\"menu\" value=\"false\">';
    html+='<param name=\"wmode\" value=\"' + wmode + '\">';
    html+='<param name=\"FlashVars\" value=\"' + param + '\">';
    html+='<embed src=\"' + url + '\" quality=\"high\" wmode=\"' + wmode + '\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"' + width + '\" height=\"' + height + '\" FlashVars=\"' + param + '\"></embed>';
    html+='</object>';
	
	//adCo(param);
	document.write(html);
	}

function adFlashDiv(width, height, wmode, url, divID, divWidth, divHeight, divTop, divLeft, divRight, clss, style, param)
{
	var html;
	
	if (wmode == null) wmode = "transparent";
	
	html='<div style=\"position:relative;width:' + divWidth + 'px;height:' + divHeight + 'px;\"';
	if(divID!=null) html+=' id=\"' + divID + '\"';
	html+='>';
	html+='<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"' + width + '\" height=\"' + height + '\"';
	if(clss!=null) html+=' class=\"' + clss + '\"';
	if(style!=null) html+=' style=\"position:absolute;';
	if(divTop!=null) html+=' top=' + divTop + ';';
	if(divLeft!=null) html+=' left=' + divLeft + ';';
	if(divRight!=null) html+=' right=' + divRight + ';';
	if(divRight!=null) html+=style + '\"';
	html+='>';
	html+='<param name=\"movie\" value=\"' + url + '\">';
    html+='<param name=\"quality\" value=\"high\">';
    html+='<param name=\"menu\" value=\"false\">';
    html+='<param name=\"wmode\" value=\"' + wmode + '\">';
    html+='<param name=\"FlashVars\" value=\"' + param + '\">';
    html+='<embed src=\"' + url + '\" quality=\"high\" wmode=\"' + wmode + '\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"' + width + '\" height=\"' + height + '\" FlashVars=\"' + param + '\"></embed>';
    html+='</object>';
	
	//adCo(param);
	document.write(html);
	}

function adPic(width, height, link1, border, title, pic, clss, style, param)
{
	var html;
	
	if (border == null) border = "0";
	
	html='<a href=\"' + link1 + '\" target=\"_blank\"><img src=\"' + pic + '\" width=\"' + width + '\" height=\"' + height + '\"';
	if(title!=null) html+=' title=\"' + title + '\"';
	if(border!=null) html+=' border=\"' + border + '\"';
	if(clss!=null) html+=' class=\"' + clss + '\"';
	if(style!=null) html+=' style=\"' + style + '\"';
	html+='></a>';
	
	//adCo(param);
	document.write(html);
	}

function adSrc(src, width, height, style, clss, param)
{
	var html;
	
	html='<div style=\"width:' + width + 'px;height:' + height + 'px;';
	if(style!=null) html+=style + '\"';
	if(clss!=null) html+=' class=\"' + clss + '\"';
	html+='>';
	html+=src;
	html+='<\div>';
	
	//adCo(param);
	document.write(html);
	}

function adCo(param){
	var strText = null;
	var rndTime = (new Date()).getTime();
	var gonderUrl = 'sb.asp?t=' + param + '&rnd=' + rndTime;
	$.ajax({
		url: gonderUrl,
		async: false, dataType: 'text',
		success: function(text) {
			strText = text;
		}, 
		error: function(http, message, exc) {
			strText = null;
	}});
	alert(strText);
	//alert(gonderUrl);
	return strText;
}

