function embedflowplayer3(objid, video, autostart, autobuffer, SCI)
{	    
    varray = video.split("/");
    lastelem = varray[varray.length-1];
    id_video = lastelem.split(".")[0];
    
    site_code = 0;
    _host = document.location.host;
    ddomain = _host.split(".")[1]+"."+_host.split(".")[2];
    if (ddomain == "austria.com")
	flowplayer_key = "#@cd985b1f346f662a7df";
    if (ddomain == "vol.at")
	flowplayer_key = "#@4a704359fa2fa42f9cb";
    if (ddomain == "vienna.at")
	flowplayer_key = "#@08bab8e7152225f725d";
    if (ddomain == "salzburg24.at")
	flowplayer_key = "#@b26aaaae0b63f913e64";
	
    if (ddomain == "boon.hu")
	flowplayer_key = "#@053322c900b82de303e";
    if (ddomain == "mon.hu")
	flowplayer_key = "#@ba864ab5ccd09243c6b";
    if (ddomain == "szon.hu")
	flowplayer_key = "#@42ba5ed767b2277c35c";
    if (ddomain == "haon.hu")
	flowplayer_key = "#@6572d16693ac3ee88b0";
    if (ddomain == "erdon.ro")
	flowplayer_key = "#@d4de680458f56102a69";
    if (ddomain == "toapro.hu")
	flowplayer_key = "#@caaf297aeacf152d3b4";
    if (ddomain == "toplak.hu")
	flowplayer_key = "#@cbce07d0abe828281cf";
	
    if (ddomain == "aradon.ro")
	flowplayer_key = "#@a0d9d81619389ea12eb";
    if (ddomain == "caon.ro")
	flowplayer_key = "#@29fc37d7b183dbc1892";
    if (ddomain == "huon.ro")
	flowplayer_key = "#@138889a46a2a1831d6d";
    if (ddomain == "tion.ro")
	flowplayer_key = "#@1506380455766c71e5a";
    if (ddomain == "bihon.ro")
	flowplayer_key = "#@a80041273f8254b61b1";
    if (ddomain == "clon.ro")
	flowplayer_key = "#@56e9918afbb2ef66d77";
    if (ddomain == "roon.ro")
	flowplayer_key = "#@f78af9d7e487c3b4b06";
    if (ddomain == "culinar.ro")
	flowplayer_key = "#@5aac3cfa6ffdd93348d";
    if (ddomain == "publi24.ro")
	flowplayer_key = "#@326bf762a68484ff4eb";
    if (ddomain == "animalutul.ro")
	flowplayer_key = "#@1dc401fd311ed2ae014";
    if (ddomain == "infogradina.ro")
	flowplayer_key = "#@8be68370aba2baa2ab0";
    if (ddomain == "infomariaj.ro")
	flowplayer_key = "#@fb7f8fd4365fa4e72c8";
//    if (ddomain == "")
//	flowplayer_key = "";
    _base_url = "http://"+_host+"/media_tp/custom/flowplayer3/swf/";
    $.ajax({
	url: "http://"+_host+"/infovideo.php?video="+video,
	cache: false,
	async: false,
        success: function(data_str){
	    data = eval(data_str);
	    schedules = [];
    	    is_pre = false;
	    is_post = false;
	    is_mid = false;
 	    is_overlayed = false;
	    count = 0;
	    overlay_position_x = "bottom";
	    overlay_position_y = "left";
	    overlay_width = 0;
	    overlay_height = 1;    
	    companion_position = "bottom";
	    $.each(data.ads, function(i,item){
		site_code = item.zone.split("/")[0];
		ad_zone = item.zone.split("/")[1]+"/"+item.zone.split("/")[2];
		if ((item.type==1) && (!is_pre)){
		    schedules[count] = {
            		"zone": ad_zone,
                	"position": "pre-roll"
	    	    }
	    	    is_pre = true;
		    count++;
    		}
		if ((item.type==2) && (!is_mid)){
	    	    schedules[count] = {
            		"zone": ad_zone,
            		"position": "mid-roll",
			"startTime": "00:00:"+item.start_time
        	    }
		    is_mid = true;
		    count++;
		}
		if ((item.type==3) && (!is_post)){
		    schedules[count] = {
            		"zone": ad_zone,
            		"position": "post-roll"
        	    }
		    is_post = true;
		    count++;
		}
		if ((item.type==4) && (!is_overlayed)){
		    schedules[count] = {
			"zone": ad_zone,
			"startTime": "00:00:"+item.start_time,
			"duration": item.duration,
			"position": "overlayzone"
		    }
		    if (item.position_x == 1)
			overlay_position_x = "left"; 
		    if (item.position_x == 2)
			overlay_position_x = "center";
		    if (item.position_x == 3)
			overlay_position_x = "right";
		    if (item.position_y == 1)
			overlay_position_y = "top";
		    if (item.position_y == 2)
			overlay_position_y = "center";
		    if (item.position_y == 3)
			overlay_position_y = "bottom";
		    overlay_width = item.width;
		    overlay_height = item.height;
		    is_overlayed = true;
		    count++;
	        }	
		if ((item.type==5) && (!is_overlayed)){
		    schedules[count] = {
			"zone": ad_zone,
			"startTime": "00:00:"+item.start_time,
			"duration": item.duration,
			"position": "overlayzone"
		    }
		    if (item.companion_pos == 1)
			companion_position = "companion-right";
 		    if (item.companion_pos == 2)
			companion_position = "companion-bottom";
		    is_overlayed = true;
		    count++;
		}
		if ((item.type==6) && (!is_overlayed)){
		    schedules[count] = {
			"zone": ad_zone,
			"startTime": "00:00:"+item.start_time,
			"duration": item.duration,
			"position": "overlayzone"
		    }
		    if (item.position_x == 1)
			overlay_position_x = "left"; 
		    if (item.position_x == 2)
			overlay_position_x = "center";
		    if (item.position_x == 3)
			overlay_position_x = "right";
		    if (item.position_y == 1)
			overlay_position_y = "top";
		    if (item.position_y == 2)
			overlay_position_y = "center";
		    if (item.position_y == 3)
			overlay_position_y = "bottom";
		    overlay_width = item.width;
		    overlay_height = item.height;
		    if (item.companion_pos == 1)
			companion_position = "companion-right";
 		    if (item.companion_pos == 2)
			companion_position = "companion-bottom";
		    is_overlayed = true;
		    count++;
	        }	
	    });
	    flashvars = {
		key: flowplayer_key,
		logo: { opacity: 0 },
		plugins: {
    		    controls: {
        		autoHide: "always",
			background: "url(http://"+_host+"/increment_embed.php?name="+id_video+".jpg?v=2) no-repeat"
    		    },

    		    openAdStreamer: {
			autoBuffering:true,
			autoPlay:true,
        		url: _base_url+'OpenAdStreamer-0.2.5.swf',
        		"shows": {
            	    	    "streams": [
				{ "file":video,"duration":"00:00:"+(data.duration)}
            		    ]
        		},
        		"deliveryType": "progressive",
        		"streamType": "flv",

			"overlays": {
    			    "regions": [{
				"id":"overlayzone",
				"verticalAlign":overlay_position_y,
				"horizontalAlign": overlay_position_x,
				"width": overlay_width,
				"height": overlay_height
			    }]
			},

        		"ads": {
        		    "pauseOnClickThrough": false,
            		    "server": {
				type: "smart",
                		vastURL: "http://ww206.smartadserver.com/call/pubj",
                		site: site_code,
                		track: true,
                		cacheBurst: true,
                		targeting: true
            		    },
			    "companions": [
				{ "id":companion_position, "width":"300", "height":"250" },
			    ],
			    "schedule": schedules
        		}
    		    }
		}
	    }
//	    $f(objid, _base_url+"flowplayer.commercial.swf", {
	    $("#flashvars_id").val("'config="+JSON.stringify(flashvars)+"'");

	    flowplayer(objid, _base_url+"flowplayer.commercial.swf", flashvars);   
	}
    });
//    alert ($("#flashcontent").html())
}