﻿/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try { xmlhttp = new XMLHttpRequest();

   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
 
@end @*/

if (window.XMLHttpRequest)
{
xmlhttp =new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
xmlhttp =new ActiveXObject("Microsoft.XMLHTTP")
}



//if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 // xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
//else
//xmlhttp= new XMLHttpRequest();} 

function loadFragmentInToElement(fragment_url,element_id) {
   var element = document.getElementById(element_id);
   xmlhttp.open("GET", fragment_url);
   xmlhttp.onreadystatechange = function() {
     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
     element.innerHTML = xmlhttp.responseText;

    }
   }
   xmlhttp.send(null);
  

}
//window.setInterval("loadFragmentInToElement('http://kasper/utveckling/ajax/artikelindex.asp', 'content')", 1000);

function visa(content){
var myRandom=parseInt(Math.random()*99999999);

adress='http://www.coolaklockor.se/kundvagn_ajax/kundvagn.asp';
adress=adress + "?rand=" + myRandom

loadFragmentInToElement(adress,content);}

 
function  kundvagn(){
//i=document.getElementById('layer2').innerHTML;
//document.getElementById('start').innerHTML=i;

if (i<=315){
document.getElementById('sphere').style.clip='rect(auto '+i+'px '+i+'px auto)';

}
else{ 
window.clearInterval(timerid);

}

i=i+15;
}
 
function  starta(){
timerid=window.setInterval("kundvagn()",1);
i=0;
document.getElementById('sphere').style.display = "";

visa('sphere');}

var i=0;
var timerid
function  closekundv(){
document.getElementById('sphere').style.clip='rect(0px 0px 0px 0px)';
i=0
window.clearInterval(timerid);

}




	



