// JavaScript Document
/**
*   @Theme Name: DMobil             
*   @Description: template DMobil   
*   @Version: 1.0                   
*   @Author: Tsurcan Dmitry         
*   @Date: 2009.10.20                   
*/

function tabs_menu(i, num)
{
    for(k = 1; k <= num; k++)   
    {
        jQuery('#bock_'+k).attr('class','hide_div');
        jQuery('#item_m'+k).attr('class','off');
        jQuery('#m'+k).val(2);
    }
    jQuery('#bock_'+i).attr('class','show_div');
    jQuery('#item_m'+i).attr('class','off on');
    jQuery('#m'+i).val(1);
}

function mb_hide(id)
{        
    if (jQuery('#'+id).val() == 2 )
    {        
        jQuery('#item_'+id).attr('class','off');
    }   
}

function cssmenuhover()
{
        if(!document.getElementById("cssmenu"))
                return;
        var lis = document.getElementById("cssmenu").getElementsByTagName("LI");
        for (var i=0;i<lis.length;i++)
        {
                lis[i].onmouseover=function(){this.className+=" iehover";}
                lis[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" iehover\\b"), "");}
        }
}
if (window.attachEvent)
        window.attachEvent("onload", cssmenuhover);

function clear_flv()
{
    jQuery('#button_div').attr('class','hide_div');
    jQuery('#flash_div').attr('class','hide_div');    
    jQuery('#clear_flv').html("<div id='div_flv'></div>");
    jQuery('#busy_layer').css('display', 'none');
    
    if (typeof(timeout_id) == 'number')
	clearTimeout(timeout_id);
}

function video_flash(url_player, url_video, div, time)
{
    jQuery('#button_div').attr('class','show_div');
    jQuery('#flash_div').attr('class','show_div');        
    var flashvars = {"comment":"video","st":"/video12.txt","file":url_video};
    var params = {wmode:"transparent", allowFullScreen:"true", allowScriptAccess:"always"}; 
    new swfobject.embedSWF(url_player, "div_flv", "525", "316", "9.0.0", false, flashvars, params);
    timeout_id = window.setTimeout(clear_flv, time*1000);
}

function video_flash_min(url_player, url_video, div, time)
{    
    jQuery('#button_div').attr('class','show_div');
    jQuery('#flash_div').attr('class','show_div');      
    var flashvars = {"comment":"video","st":"/minstyle.txt","file":url_video};
    var params = {wmode:"transparent", allowFullScreen:"true", allowScriptAccess:"always"}; 
    new swfobject.embedSWF(url_player, "div_flv", "525", "316", "9.0.0", false, flashvars, params);
    timeout_id = window.setTimeout(clear_flv, time*1000);
}

function open_email_form2( url ){
    jQuery('#yourname').attr('disabled', false);
    jQuery('#companyname').attr('disabled', false);
    jQuery('#youremail').attr('disabled', false);
    jQuery('#yourremarks').attr('disabled', false);
    jQuery('#friendname').attr('disabled', false);
    jQuery('#friendemail').attr('disabled', false);
    jQuery('#imageverify').attr('disabled', false);
    jQuery('#wp-email-submit').attr('disabled', false); 
    
    jQuery('#send_to_friend').css( 'display', 'block' );
    jQuery('#busy_layer').css('display', 'block');
    jQuery('#wp-email-content').css( 'display', 'block' );
    jQuery('#wp-email-result').css( 'display', 'none' );
    jQuery('#wp-email-loading').css( 'display', 'none' );
    jQuery('#wp-email-captcha').html('<img style="vertical-align:middle" height="15" width="55" alt="E-Mail Image Verification" src="' + url + '/wp-content/plugins/wp-email/email-image-verify.php"/>');
    return false;
}

function open_email_form(){
    jQuery('#call_me_back').css( 'display', 'block' );
    jQuery('#busy_layer').css('display', 'block');
    jQuery('.wpcf7_dmobil').css( 'display', 'block' );
    jQuery('#wpcf7-result').css( 'display', 'none' );
    return false;
}

function open_registration_agreement(){
    jQuery('#dm-agreement').css( 'display', 'block' );
    jQuery('#busy_layer').css('display', 'block');
    jQuery('#dm-agreement-content').css( 'display', 'block' )    
    return false;
}

function open_microsoft_registration_agreement(){
    jQuery('#dm-microsoft-agreement').css( 'display', 'block' );
    jQuery('#busy_layer').css('display', 'block');
    jQuery('#dm-microsoft-agreement-content').css( 'display', 'block' )    
    return false;
}
function open_upc_registration_agreement(){
    jQuery('#dm-upc-agreement').css( 'display', 'block' );
    jQuery('#busy_layer').css('display', 'block');
    jQuery('#dm-upc-agreement-content').css( 'display', 'block' )       
    return false;
}


function change_top()
{
    var  y = 0;
	var  d = 0;

 y = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
	y +=100;

	d = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
	d = Math.round(d/2);
	
	jQuery('#button_div').css( 'left', d + 240 +'px');
	
	jQuery('#flash_div').css( 'top', y+'px');
	jQuery('#button_div').css( 'top', y-22+'px');
//	jQuery('#busy_layer').css( 'top', y-100+'px');

}

function copy_name(id_from, id_to){
    jQuery('#'+id_to).html(jQuery('#'+id_from).val());
}