var http = createRequestObject();
function createRequestObject()
{
 var xmlhttp;
  /*@cc_on

  @if (@_jscript_version >= 5)

    try {

      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {

        xmlhttp = false;

      }

    }

  @else

  xmlhttp = false;

  @end @*/

 if(!xmlhttp && typeof XMLHttpRequest != 'undefined')
 {
  try
  {
   xmlhttp = new XMLHttpRequest();

  }
  catch(e)
  {
   xmlhttp = false;
  }

 }

 return xmlhttp;
}



function cardurl(){
link='picsshow.php?do='+document.sendcard.cardpic.value+'';
http.open('get', link);
http.onreadystatechange = handleLink;
http.send(null);
}
/*function backgroundurl()
{
link='picsshow.php?back='+document.sendcard.bgpic_url.value+'';
http.open('get', link);
http.onreadystatechange = bhandleLink;
http.send(null);
  }*/
function handleLink(){
    if(http.readyState == 1){
        document.getElementById('cardshow').innerHTML = 'جاري طلب البطاقة انتظر قليلاً...';
    }
    if(http.readyState == 4){
        var response = http.responseText;
        document.getElementById('cardshow').innerHTML = response;
    }
}
/*function bhandleLink(){
    if(http.readyState == 1){
        document.getElementById('background').innerHTML = 'تم طلب الخلفية..';
    }
    if(http.readyState == 4){
        var response = http.responseText;
        document.getElementById('background').innerHTML = response;
    }
}*/

function playmusic(){
var abc=document.sendcard.sound.options[document.sendcard.sound.selectedIndex].value
if (abc==""){alert("الرجاء تحديد الملف المراد الاستماع إليه"); return ;}
var url='playmusic.php?file='+abc+'';
t=screen.height/2-100;
w=screen.width/2-100;
window.open(url, null,"height=80,width=200,directories=no,status=no,toolbar=no,menubar=no,location=no,top="+t+",left="+w+"")
}

function backgroundurl(){
if (document.body){
document.body.background = document.sendcard.bgpic_url.value;
}
}