VMTSubmitForm = {
    frame : function(c) {
        var n = 'cible_' + Math.floor(Math.random() * 99999);
        var d = document.createElement('DIV');
        d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="VMTSubmitForm.loaded(\''+n+'\')"></iframe>';
		document.body.appendChild(d);
        var i = document.getElementById(n);
		
        if (c && typeof(c.onComplete) == 'function') {
			i.onComplete = c.onComplete;
			i.idform = c.idform;
		}
        return n;
    },
    form : function(f, name) {
        f.setAttribute('target', name);
    },
    submit : function(f, c) {
        VMTSubmitForm.form(f, VMTSubmitForm.frame(c));
		if (c && typeof(c.onStart) == 'function') return c.onStart(c.idform);
        else return true;
    },
    loaded : function(id) {
        var i = document.getElementById(id);
		
        if (i.contentDocument) var d = i.contentDocument;
        else if (i.contentWindow) var d = i.contentWindow.document;
        else var d = window.frames[id].document;
		
        if (d.location.href == "about:blank") return;
        if (typeof(i.onComplete) == 'function') i.onComplete(d.body.innerHTML,i.idform);
		var idframe = $(i).attr('id');
		setTimeout('$("#' + idframe + '").parent().remove();',200);
    }
}

//eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4 v(u,0,f){p(f!=\'\'){1 q=e(f);p(!q)9 i}9 w.C(u,{\'B\':n,\'z\':m,\'0\':0})}4 n(0){$(\'#\'+0+\'s\').b(\'a\',\'\');$(\'#\'+0+\'c\').b(\'a\',\'h\');$(\'#\'+0+\'c\').j(\'\');9 A}4 m(r,0){$(\'#\'+0+\'s\').b(\'a\',\'h\');$(\'#\'+0+\'c\').b(\'a\',\'\');e(\'1 2 = \'+r);6(1 x 3 2){M(x){8\'Q\':6(1 y 3 2[x]){$(\'#\'+y).j(2[x][y])}7;8\'S\':6(1 y 3 2[x]){e(2[x][y])}7;8\'l\':1 5=2[x].k(/&o;/g,"&");t.l.O=5;7;8\'D\':6(1 y 3 2[x]){1 5=2[x][y].k(/&o;/g,"&");t.R(5)}7}}}4 P(){1 d=N G();$F(\'E\').H=\'?I=L&K=\'+d.J();9 i}',55,55,'idform|var|data|in|function|link|for|break|case|return|display|css|_result||eval|validate_func||none|false|html|replace|location|vmtCompleteSubmitForm|vmtStartSubmitForm|amp|if|test|response|_loading|window|object|vmtPressSubmitForm|VMTSubmitForm|||onComplete|true|onStart|submit|open_link|imgcaptcha|vmt|Date|src|mod|getTime|code|imagecaptcha|switch|new|href|changeImageCaptcha|tagid|open|script'.split('|')))

//start encode script part

function vmtPressSubmitForm(object, idform, validate_func) {
	if (validate_func != '') {
		var test = eval(validate_func);
		if (!test) return false
	}
	return VMTSubmitForm.submit(object, {
		'onStart': vmtStartSubmitForm,
		'onComplete': vmtCompleteSubmitForm,
		'idform': idform
	})
}
function vmtStartSubmitForm(idform) {
	$('#' + idform + '_loading').css('display', '');
	$('#' + idform + '_result').css('display', 'none');
	$('#' + idform + '_result').html('');
	return true
}
function vmtCompleteSubmitForm(response, idform) {
	$('#' + idform + '_loading').css('display', 'none');
	$('#' + idform + '_result').css('display', '');
	eval('var data = ' + response);
	for (var x in data) {
		switch (x) {
		case 'tagid':
			for (var y in data[x]) {
				$('#' + y).html(data[x][y])
			}
			break;
		case 'script':
			for (var y in data[x]) {
				eval(data[x][y])
			}
			break;
		case 'location':
			var link = data[x].replace(/&amp;/g, "&");
			window.location.href = link;
			break;
		case 'open_link':
			for (var y in data[x]) {
				var link = data[x][y].replace(/&amp;/g, "&");
				window.open(link)
			}
			break
		}
	}
}
function changeImageCaptcha() {
	var d = new Date();
	$vmt('imgcaptcha').src = '?mod=imagecaptcha&code=' + d.getTime();
	return false
}
// end encode script part




function doConfirm(url, msg) {
  if (confirm(msg)) {
    document.location = url;
  }
}

function $vmt() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}

function toogleDisabled(id)
{
	if($vmt(id).disabled)
		$vmt(id).disabled = "";
	else
		$vmt(id).disabled = "disabled";
}
function doalert(msg)
{
    //node_type = 'radio';
    var total = document.getElementById('count').value;
    var name_tag;
    var arr = Array;
    var ck;
    var j;
    for(var i=1;i<=total;i++)
    {
      name_tag = 'feedback_'+i;
      arr = document.getElementsByName(name_tag);
      ck=0;
      for(j=0;j<arr.length;j++)
      {
		if(arr[j].checked && typeof(arr[j])=='object') ck=1;
      }
      if(ck==0)
      {
		alert(msg);
		return false;
      }
    }
    return true;
    
}
function mykeyupcode(e,obj){
	try{
		if (window.event) e = window.event;
		if (e.keyCode == 13){
			e.returnValue=false;
			e.cancel = true;
			obj.form.bttsubmit.click();
		}
	}catch(err){}
}

function getDocumentWidth()
{
	return document.body.clientWidth;
	var width;
	if(document.documentElement
			&& document.documentElement.offsetWidth
			&& document.documentElement.offsetWidth > 0) {
		width = document.documentElement.offsetWidth;
	} else {
		width = document.body.offsetWidth;
	}
	return width;
}

function myToogleBlock(id)
{
	if($vmt(id).style.display=='none')
		$vmt(id).style.display='block';
	else
		$vmt(id).style.display='none';
}

function checkEmail(str)
{
	var filter = /.+@.+\..+/;
	if (!filter.test(str)) {
		return false;
	}
	return true;
}
