// clipboard, worked with copy.swf
var mezi_clipboard = {
    _tip:null,
    redir: function(url){if(this._tip){$('#'+this._tip).hide();} window.open(url);},
    mouse: function(status,tips){
    	var parent = '';
    	if(status=='over'){
    		if(parent=$('#'+tips).parent('div.dealclipbox')){parent.css('z-index',10);} 
    		$('#'+tips).show();
    		this._tip=tips;
    	}else{
    		if(parent=$('#'+tips).parent('div.dealclipbox')){parent.css('z-index',0);} 
    		$('#'+tips).hide();
    	}
    }
};

//create flash script for copy coupon code to clipboard
var createFlash = function(coupon_code,coupon_id,store_url){
	var file_server = fileServer || "http://files.smarter.com/";
	if('No Code Required'==coupon_code){return '';}
    if($.browser.msie){
        //for IE 
        var object_head = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="17" height="15" id="copy_'+coupon_id+'"> \n'+ 
		'<param name="movie" value="'+file_server+'jscript/copy.swf" /> \n';
    }else{
         var object_head = '<object width="17" height="15" data="'+file_server+'jscript/copy.swf" type="application/x-shockwave-flash">';
    }
    var str= object_head+
		'<param value="high" name="quality"/>\n'+
		'<param value="always" name="allowScriptAccess"/>\n'+
		'<param value="transparent" name="wMode"/>\n'+
		'<param value="true" name="swLiveConnect"/>\n'+
		'<param value="cpy='+coupon_code+'&amp;tip=clipbox_'+coupon_id+'&amp;url='+encodeURIComponent(store_url)+'" name="flashVars"/>\n'+
	       '</object>\n'+
	   '<div class="clipbox" id="clipbox_'+coupon_id+'">Click icon to copy Code to Clipboard and<br />press <i>[Ctrl+V]</i> during checkout to paste Code.\n'+
		'<div class="bottomcow"><span>*</span>If prompted, please allow access to Clipboard</div>\n'+
	   '</div>\n';
    // alert(str+Math.random()+'');
     return str;
};